mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Periodically update avialable chat themes list
This commit is contained in:
@@ -101,7 +101,7 @@ func _internal_getChatThemes(accountManager: AccountManager<TelegramAccountManag
|
||||
}
|
||||
}
|
||||
|> mapToSignal { current, hash -> Signal<[ChatTheme], NoError> in
|
||||
if onlyCached {
|
||||
if onlyCached && !current.isEmpty {
|
||||
return .single(current)
|
||||
} else {
|
||||
return .single(current)
|
||||
@@ -151,3 +151,11 @@ extension ChatTheme {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func managedChatThemesUpdates(accountManager: AccountManager<TelegramAccountManagerTypes>, network: Network) -> Signal<Void, NoError> {
|
||||
let poll = _internal_getChatThemes(accountManager: accountManager, network: network)
|
||||
|> mapToSignal { _ -> Signal<Void, NoError> in
|
||||
return .complete()
|
||||
}
|
||||
return (poll |> then(.complete() |> suspendAwareDelay(1.0 * 60.0 * 60.0, queue: Queue.concurrentDefaultQueue()))) |> restart
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user