From 2fdd5e23c700b02c07b4ec50d81822f4b096c18b Mon Sep 17 00:00:00 2001 From: CMK Date: Thu, 16 Sep 2021 16:58:29 +0800 Subject: [PATCH] fix: add new account via register entry not trigger app state update issue --- .../MastodonConfirmEmailViewController.swift | 3 ++- .../Settings/SettingsViewController.swift | 27 +++---------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/Mastodon/Scene/Onboarding/ConfirmEmail/MastodonConfirmEmailViewController.swift b/Mastodon/Scene/Onboarding/ConfirmEmail/MastodonConfirmEmailViewController.swift index 9e9235baf..1abb35617 100644 --- a/Mastodon/Scene/Onboarding/ConfirmEmail/MastodonConfirmEmailViewController.swift +++ b/Mastodon/Scene/Onboarding/ConfirmEmail/MastodonConfirmEmailViewController.swift @@ -131,7 +131,8 @@ extension MastodonConfirmEmailViewController { } } receiveValue: { response in os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: user %s's email confirmed", ((#file as NSString).lastPathComponent), #line, #function, response.value.username) - self.dismiss(animated: true, completion: nil) + self.coordinator.setup() + // self.dismiss(animated: true, completion: nil) } .store(in: &self.disposeBag) } diff --git a/Mastodon/Scene/Settings/SettingsViewController.swift b/Mastodon/Scene/Settings/SettingsViewController.swift index e93668801..7804a70de 100644 --- a/Mastodon/Scene/Settings/SettingsViewController.swift +++ b/Mastodon/Scene/Settings/SettingsViewController.swift @@ -189,7 +189,7 @@ class SettingsViewController: UIViewController, NeedsDependency { if let activeSubscription = setting.activeSubscription { self.whoButton.setTitle(activeSubscription.policy.title, for: .normal) } else { - assertionFailure() + // assertionFailure() } } } @@ -199,27 +199,6 @@ class SettingsViewController: UIViewController, NeedsDependency { let footer = "Mastodon v\(UIApplication.appVersion()) (\(UIApplication.appBuild()))" let metaContent = PlaintextMetaContent(string: footer) tableFooterLabel.configure(content: metaContent) - - // FIXME: - // needs a workaround for GitHub link -// viewModel.currentInstance -// .receive(on: RunLoop.main) -// .sink { [weak self] instance in -// guard let self = self else { return } -// let version = instance?.version ?? "-" -// let link = #"mastodon/mastodon"# -// let content = L10n.Scene.Settings.Footer.mastodonDescription(link, version) -// let mastodonContent = MastodonContent(content: content, emojis: [:]) -// do { -// let metaContent = try MastodonMetaContent.convert(document: mastodonContent) -// self.tableFooterLabel.configure(content: metaContent) -// } catch { -// let metaContent = PlaintextMetaContent(string: "") -// self.tableFooterLabel.configure(content: metaContent) -// assertionFailure() -// } -// } -// .store(in: &disposeBag) } private func setupView() { @@ -276,7 +255,7 @@ class SettingsViewController: UIViewController, NeedsDependency { tableView.tableFooterView = tableFooterView } - func alertToSignout() { + func alertToSignOut() { let alertController = UIAlertController( title: L10n.Common.Alerts.SignOut.title, message: L10n.Common.Alerts.SignOut.message, @@ -423,7 +402,7 @@ extension SettingsViewController: UITableViewDelegate { .store(in: &disposeBag) case .signOut: feedbackGenerator.impactOccurred() - alertToSignout() + alertToSignOut() } } }