mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-08 19:10:53 +00:00
better isEqual for ChatTheme
This commit is contained in:
parent
800cfaf6c5
commit
f56f138aec
@ -104,9 +104,24 @@ public enum ChatTheme: PostboxCoding, Codable, Equatable {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case let .gift(lhsGift, lhsThemeSettings):
|
||||
if case let .gift(rhsGift, rhsThemeSettings) = rhs {
|
||||
return lhsGift == rhsGift && lhsThemeSettings == rhsThemeSettings
|
||||
case let .gift(lhsGift, _):
|
||||
if case let .gift(rhsGift, _) = rhs {
|
||||
switch lhsGift {
|
||||
case .generic(let lhsGeneric):
|
||||
switch rhsGift {
|
||||
case .generic(let rhsGeneric):
|
||||
return lhsGeneric == rhsGeneric
|
||||
default:
|
||||
return false
|
||||
}
|
||||
case .unique(let lhsUnique):
|
||||
switch rhsGift {
|
||||
case .unique(let rhsUnique):
|
||||
return lhsUnique.id == rhsUnique.id
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user