diff --git a/Pachyderm/Sources/Pachyderm/Utilities/StatusState.swift b/Pachyderm/Sources/Pachyderm/Utilities/StatusState.swift index c3b380c954..3bb71e9b60 100644 --- a/Pachyderm/Sources/Pachyderm/Utilities/StatusState.swift +++ b/Pachyderm/Sources/Pachyderm/Utilities/StatusState.swift @@ -8,7 +8,7 @@ import Foundation -public class StatusState: Equatable, Hashable { +public class StatusState: Equatable { public var collapsible: Bool? public var collapsed: Bool? diff --git a/Tusker/Screens/Explore/TrendingStatusesViewController.swift b/Tusker/Screens/Explore/TrendingStatusesViewController.swift index be39dc2ef1..56f10fb32a 100644 --- a/Tusker/Screens/Explore/TrendingStatusesViewController.swift +++ b/Tusker/Screens/Explore/TrendingStatusesViewController.swift @@ -122,6 +122,27 @@ extension TrendingStatusesViewController { case status(id: String, state: StatusState) case loadingIndicator + static func ==(lhs: Item, rhs: Item) -> Bool { + switch (lhs, rhs) { + case (.status(id: let a, state: _), .status(id: let b, state: _)): + return a == b + case (.loadingIndicator, .loadingIndicator): + return true + default: + return false + } + } + + func hash(into hasher: inout Hasher) { + switch self { + case .status(id: let id, state: _): + hasher.combine(0) + hasher.combine(id) + case .loadingIndicator: + hasher.combine(1) + } + } + var hideSeparators: Bool { if case .loadingIndicator = self { return true