Commit 36b4bae9 authored by Jose Blaya's avatar Jose Blaya
Browse files

- Show login view after dismiss the Walkthrough view controller.

- Hide navigation bar buttons when not logged
parent e4aa358d
......@@ -117,6 +117,8 @@ class DashboardViewController: AutolayoutViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
setupNavigationBarButtons()
guard AppPreferences.shared.wasLaunched && !Flags.shared.alwaysShowsWalkthrough else {
AppPreferences.shared.wasLaunched = true
showWalkthrough()
......@@ -166,6 +168,14 @@ class DashboardViewController: AutolayoutViewController {
// MARK: Actions
private func setupNavigationBarButtons() {
guard AppPreferences.shared.wasLaunched,
!Flags.shared.alwaysShowsWalkthrough,
Client.providers.accountProvider.isLoggedIn else {
navigationItem.leftBarButtonItem = nil
navigationItem.rightBarButtonItem = nil
return
}
switch self.tileModeStatus { //change the status
case .normal:
if let leftBarButton = navigationItem.leftBarButtonItem,
......@@ -254,8 +264,8 @@ class DashboardViewController: AutolayoutViewController {
if let presented = self.navigationController?.presentedViewController,
presented != self {
presented.dismiss(animated: true, completion: {
self.present(vc, animated: false, completion: nil)
self.present(vc, animated: true, completion: {
presented.dismiss(animated: true, completion: nil)
})
} else {
present(vc, animated: false, completion: nil)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment