Skip to content

Commit

Permalink
起動時のverify_credentialsに失敗すると何も出ないバグの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
rinsuki committed Dec 6, 2018
1 parent f941544 commit f583570
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions iMast/AppDelegate.swift
Expand Up @@ -29,21 +29,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
initDatabase()
UserDefaults.standard.setValue(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")

// とりあえずlaunchScreen出しとく
if let launchScreen = R.storyboard.launchScreen.instantiateInitialViewController() {
changeRootVC(launchScreen, animated: false)
}

let myAccount = MastodonUserToken.getLatestUsed()
if let myAccount = myAccount {
changeRootVC(MainTabBarController(), animated: false)
myAccount.getUserInfo().then { json in
if json["error"].string != nil && json["_response_code"].number == 401 {
myAccount.delete()
if let vc = R.storyboard.login.instantiateInitialViewController() {
changeRootVC(vc, animated: false)
}
} else {
changeRootVC(MainTabBarController(), animated: false)
}
}
} else {
Expand Down

0 comments on commit f583570

Please sign in to comment.