diff --git a/Tusker/Scenes/ComposeSceneDelegate.swift b/Tusker/Scenes/ComposeSceneDelegate.swift index c97a36b9..2ae505a5 100644 --- a/Tusker/Scenes/ComposeSceneDelegate.swift +++ b/Tusker/Scenes/ComposeSceneDelegate.swift @@ -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() }