fix: "New Post" quick action not check precondition issue

This commit is contained in:
CMK 2021-07-27 14:03:22 +08:00
parent 17ed966dc9
commit d79ed55b0c
1 changed files with 7 additions and 3 deletions

View File

@ -132,9 +132,13 @@ extension SceneDelegate {
if coordinator?.tabBarController.topMost is ComposeViewController {
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): composing…")
} else {
let composeViewModel = ComposeViewModel(context: AppContext.shared, composeKind: .post)
coordinator?.present(scene: .compose(viewModel: composeViewModel), from: nil, transition: .modal(animated: true, completion: nil))
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): present compose scene")
if AppContext.shared.authenticationService.activeMastodonAuthenticationBox.value == nil {
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): not authenticated")
} else {
let composeViewModel = ComposeViewModel(context: AppContext.shared, composeKind: .post)
coordinator?.present(scene: .compose(viewModel: composeViewModel), from: nil, transition: .modal(animated: true, completion: nil))
logger.debug("\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): present compose scene")
}
}
case "org.joinmastodon.app.search":
coordinator?.switchToTabBar(tab: .search)