mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 14:02:48 +00:00
Merge commit '339a01463e57c38ee4f2dfe7c6087cbdaa857545'
This commit is contained in:
commit
5608bef4e6
@ -92,6 +92,7 @@ public func telegramThemes(postbox: Postbox, network: Network, forceUpdate: Bool
|
||||
public enum GetThemeError {
|
||||
case generic
|
||||
case unsupported
|
||||
case slugInvalid
|
||||
}
|
||||
|
||||
public func getTheme(account: Account, slug: String) -> Signal<TelegramTheme, GetThemeError> {
|
||||
@ -100,6 +101,9 @@ public func getTheme(account: Account, slug: String) -> Signal<TelegramTheme, Ge
|
||||
if error.errorDescription == "THEME_FORMAT_INVALID" {
|
||||
return .unsupported
|
||||
}
|
||||
if error.errorDescription == "THEME_SLUG_INVALID" {
|
||||
return .slugInvalid
|
||||
}
|
||||
return .generic
|
||||
}
|
||||
|> mapToSignal { theme -> Signal<TelegramTheme, GetThemeError> in
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user