Fix Compose window title not being set initially

This commit is contained in:
Shadowfacts 2023-04-13 10:04:48 -04:00
parent 6bd2eacb88
commit bb3f353dbc
1 changed files with 5 additions and 5 deletions

View File

@ -62,15 +62,15 @@ class ComposeSceneDelegate: UIResponder, UIWindowSceneDelegate, TuskerSceneDeleg
composeVC.delegate = self
let nav = EnhancedNavigationViewController(rootViewController: composeVC)
updateTitle(draft: composeVC.draft)
composeVC.uiState.$draft
.sink { [unowned self] in self.updateTitle(draft: $0) }
.store(in: &cancellables)
window = UIWindow(windowScene: windowScene)
window!.rootViewController = nav
window!.makeKeyAndVisible()
updateTitle(draft: composeVC.draft)
composeVC.controller.$draft
.sink { [unowned self] in self.updateTitle(draft: $0) }
.store(in: &cancellables)
NotificationCenter.default.addObserver(self, selector: #selector(themePrefChanged), name: .themePreferenceChanged, object: nil)
themePrefChanged()
}