Commit 75558f14 authored by Jose Blaya's avatar Jose Blaya
Browse files

Dismiss views correctly if we need to logout the user from the Account view

parent 4ab366ac
......@@ -83,6 +83,7 @@ class AccountViewController: AutolayoutViewController {
let nc = NotificationCenter.default
nc.addObserver(self, selector: #selector(redisplayAccount), name: .PIAAccountDidRefresh, object: nil)
nc.addObserver(self, selector: #selector(accountDidLogout(notification:)), name: .PIAAccountDidLogout, object: nil)
Client.providers.accountProvider.refreshAndLogoutUnauthorized(force: true)
}
......@@ -244,6 +245,9 @@ class AccountViewController: AutolayoutViewController {
}
// MARK: Notifications
@objc private func accountDidLogout(notification: Notification) {
dismissModal()
}
@objc private func redisplayAccount() {
currentUser = Client.providers.accountProvider.currentUser
......
......@@ -106,6 +106,8 @@ class MenuViewController: AutolayoutViewController {
override func viewDidLoad() {
super.viewDidLoad()
assert(Client.providers.accountProvider.isLoggedIn, "Menu visible while not logged in")
modalPresentationCapturesStatusBarAppearance = true
imvAvatar.image = Asset.imageRobot.image
......@@ -120,9 +122,6 @@ class MenuViewController: AutolayoutViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
assert(Client.providers.accountProvider.isLoggedIn, "Menu visible while not logged in")
currentUser = Client.providers.accountProvider.currentUser
labelUsername.text = Client.providers.accountProvider.publicUsername ?? ""
labelUsername.accessibilityLabel = L10n.Menu.Accessibility.loggedAs(Client.providers.accountProvider.publicUsername ?? "")
......
......@@ -53,7 +53,7 @@ end
def shared_main_pods
pod 'AlamofireImage'
#library_by_path('')
library_by_git('22c31aa')
library_by_git('5d20258')
#library_by_version('~> 1.1.3')
end
......
......@@ -104,10 +104,10 @@ DEPENDENCIES:
- HockeySDK
- iRate
- MBProgressHUD
- PIALibrary/Library (from `https://github.com/pia-foss/client-library-apple`, commit `22c31aa`)
- PIALibrary/Mock (from `https://github.com/pia-foss/client-library-apple`, commit `22c31aa`)
- PIALibrary/UI (from `https://github.com/pia-foss/client-library-apple`, commit `22c31aa`)
- PIALibrary/VPN (from `https://github.com/pia-foss/client-library-apple`, commit `22c31aa`)
- PIALibrary/Library (from `https://github.com/pia-foss/client-library-apple`, commit `5d20258`)
- PIALibrary/Mock (from `https://github.com/pia-foss/client-library-apple`, commit `5d20258`)
- PIALibrary/UI (from `https://github.com/pia-foss/client-library-apple`, commit `5d20258`)
- PIALibrary/VPN (from `https://github.com/pia-foss/client-library-apple`, commit `5d20258`)
- PIATunnel (from `https://github.com/pia-foss/tunnel-apple`, commit `269d6d1`)
- SideMenu (= 3.1.5)
- TPKeyboardAvoiding
......@@ -138,7 +138,7 @@ SPEC REPOS:
EXTERNAL SOURCES:
PIALibrary:
:commit: 22c31aa
:commit: 5d20258
:git: https://github.com/pia-foss/client-library-apple
PIATunnel:
:commit: 269d6d1
......@@ -146,7 +146,7 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
PIALibrary:
:commit: 22c31aa
:commit: 5d20258
:git: https://github.com/pia-foss/client-library-apple
PIATunnel:
:commit: 269d6d1
......@@ -177,6 +177,6 @@ SPEC CHECKSUMS:
SwiftyBeaver: ccfcdf85a04d429f1633f668650b0ce8020bda3a
TPKeyboardAvoiding: cb69d5ddbe90ce0170e4bc2db1e5e41d4a3ad9a4
PODFILE CHECKSUM: a04450989d901659656c00044d59574ca8952ea0
PODFILE CHECKSUM: 302166843a1e31f3dd87d3441c48ff64633b6d24
COCOAPODS: 1.5.3
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