mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
2cb6ebc410
1 changed files with 7 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue