From 282a84683b1daa54468636739372829bb2f65caa Mon Sep 17 00:00:00 2001 From: Joe Rocca Date: Tue, 24 Oct 2017 21:46:31 -0400 Subject: [PATCH] added labels equatable check to ListDiffable isEqual method, fixes #715 (#716) --- Classes/Models/RepositoryLabel.swift | 9 ++++++++- Classes/Repository/RepositoryIssueSummaryModel.swift | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Classes/Models/RepositoryLabel.swift b/Classes/Models/RepositoryLabel.swift index e72376fa..aff85eee 100644 --- a/Classes/Models/RepositoryLabel.swift +++ b/Classes/Models/RepositoryLabel.swift @@ -9,7 +9,7 @@ import Foundation import IGListKit -final class RepositoryLabel: ListDiffable { +final class RepositoryLabel: ListDiffable, Equatable { let color: String let name: String @@ -30,5 +30,12 @@ final class RepositoryLabel: ListDiffable { guard let object = object as? RepositoryLabel else { return false } return color == object.color } + + //MARK: Equatable + + static func ==(lhs: RepositoryLabel, rhs: RepositoryLabel) -> Bool { + return lhs.name == rhs.name + && lhs.color == rhs.color + } } diff --git a/Classes/Repository/RepositoryIssueSummaryModel.swift b/Classes/Repository/RepositoryIssueSummaryModel.swift index 770bb11e..39367709 100644 --- a/Classes/Repository/RepositoryIssueSummaryModel.swift +++ b/Classes/Repository/RepositoryIssueSummaryModel.swift @@ -56,5 +56,6 @@ class RepositoryIssueSummaryModel: ListDiffable { && author == object.author && created == object.created && title.attributedText.string == object.title.attributedText.string + && labels == object.labels } }