diff --git a/ProjectClock/AccountViewController.swift b/ProjectClock/AccountViewController.swift index 282ffaf..e26527a 100644 --- a/ProjectClock/AccountViewController.swift +++ b/ProjectClock/AccountViewController.swift @@ -92,23 +92,20 @@ class LoginVC: UIViewController localStorage["pass"] = pass.sha256 localStorage["id"] = $0 - ui + a.dismiss { - a.dismiss - { - // Send feedback - if login { self.msg("Login success!", "Now you can use account features, yay!") } - else { self.msg("Registration success!", "Now you have an account, yay!") } - - // Hide registration and show account detail view - AccountViewController.this.login() - } + // Send feedback + if login { self.msg("Login success!", "Now you can use account features, yay!") } + else { self.msg("Registration success!", "Now you have an account, yay!") } + + // Hide registration and show account detail view + AccountViewController.this.login() } } err: { print($0) - ui { a.dismiss { self.msg("An error occurred", "Maybe the server is on fire, just wait a few hours.") } } + a.dismiss { self.msg("An error occurred", "Maybe the server is on fire, just wait a few hours.") } } } diff --git a/ProjectClock/Utils.swift b/ProjectClock/Utils.swift index 8cee80d..2940048 100644 --- a/ProjectClock/Utils.swift +++ b/ProjectClock/Utils.swift @@ -139,7 +139,7 @@ extension UIViewController func msg(_ title: String, _ message: String) -> UIAlertController { alert(title, message, okayable: true) } /// More convenient dismiss function - func dismiss(_ completion: (() -> Void)? = nil) { dismiss(animated: false, completion: completion) } + func dismiss(_ completion: (() -> Void)? = nil) { ui { dismiss(animated: false, completion: completion) } } }