mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-06 12:43:58 +00:00
- bug fixes [skip ci]
This commit is contained in:
parent
095c03acdd
commit
9f66ca657e
@ -116,10 +116,12 @@ public enum ThemeUpdatedResult {
|
||||
}
|
||||
|
||||
private func checkThemeUpdated(network: Network, theme: TelegramTheme) -> Signal<ThemeUpdatedResult, GetThemeError> {
|
||||
guard let file = theme.file, let fileId = file.id?.id else {
|
||||
|
||||
let id = theme.settings != nil ? 0 : theme.file?.id?.id
|
||||
guard let documentId = id else {
|
||||
return .fail(.generic)
|
||||
}
|
||||
return network.request(Api.functions.account.getTheme(format: telegramThemeFormat, theme: .inputTheme(id: theme.id, accessHash: theme.accessHash), documentId: fileId))
|
||||
return network.request(Api.functions.account.getTheme(format: telegramThemeFormat, theme: .inputTheme(id: theme.id, accessHash: theme.accessHash), documentId: documentId))
|
||||
|> mapError { _ -> GetThemeError in return .generic }
|
||||
|> map { theme -> ThemeUpdatedResult in
|
||||
if let theme = TelegramTheme(apiTheme: theme) {
|
||||
@ -549,6 +551,9 @@ private func areThemesEqual(_ lhs: TelegramTheme, _ rhs: TelegramTheme) -> Bool
|
||||
if lhs.file?.id != rhs.file?.id {
|
||||
return false
|
||||
}
|
||||
if lhs.settings != rhs.settings {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user