Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 282a846

Browse files
joeroccarnystrom
authored andcommitted
added labels equatable check to ListDiffable isEqual method, fixes #715 (#716)
1 parent 9851a45 commit 282a846

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Classes/Models/RepositoryLabel.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010
import IGListKit
1111

12-
final class RepositoryLabel: ListDiffable {
12+
final class RepositoryLabel: ListDiffable, Equatable {
1313

1414
let color: String
1515
let name: String
@@ -30,5 +30,12 @@ final class RepositoryLabel: ListDiffable {
3030
guard let object = object as? RepositoryLabel else { return false }
3131
return color == object.color
3232
}
33+
34+
//MARK: Equatable
35+
36+
static func ==(lhs: RepositoryLabel, rhs: RepositoryLabel) -> Bool {
37+
return lhs.name == rhs.name
38+
&& lhs.color == rhs.color
39+
}
3340

3441
}

Classes/Repository/RepositoryIssueSummaryModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ class RepositoryIssueSummaryModel: ListDiffable {
5656
&& author == object.author
5757
&& created == object.created
5858
&& title.attributedText.string == object.title.attributedText.string
59+
&& labels == object.labels
5960
}
6061
}

0 commit comments

Comments
 (0)