Fix sudden theme switching in chat

This commit is contained in:
Ali 2019-11-08 17:21:10 +04:00
parent 16f3cd2a00
commit cbac28797a

View file

@ -790,7 +790,10 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
return view.values[PreferencesKeys.appConfiguration] as? AppConfiguration ?? .defaultValue
}
self.presentationDataDisposable = (combineLatest(context.sharedContext.presentationData, appConfiguration)
self.presentationDataDisposable = (
combineLatest(queue: .mainQueue(),
context.sharedContext.presentationData,
appConfiguration)
|> deliverOnMainQueue).start(next: { [weak self] presentationData, appConfiguration in
if let strongSelf = self {
let previousTheme = strongSelf.currentPresentationData.theme