forked from shadowfacts/Tusker
parent
3e7cb443fa
commit
49f1d6339f
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public class StatusState: Equatable, Hashable {
|
public class StatusState: Equatable {
|
||||||
public var collapsible: Bool?
|
public var collapsible: Bool?
|
||||||
public var collapsed: Bool?
|
public var collapsed: Bool?
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,27 @@ extension TrendingStatusesViewController {
|
||||||
case status(id: String, state: StatusState)
|
case status(id: String, state: StatusState)
|
||||||
case loadingIndicator
|
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 {
|
var hideSeparators: Bool {
|
||||||
if case .loadingIndicator = self {
|
if case .loadingIndicator = self {
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue