From 4b3f484a897dc80d0d6fb45aaa27fdc8a856bf7a Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sun, 16 Sep 2018 21:12:12 -0700 Subject: [PATCH] Reset modes on login/logout Signed-off-by: James Ketrenos --- frontend/src/ketr-photos/ketr-photos.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/ketr-photos/ketr-photos.html b/frontend/src/ketr-photos/ketr-photos.html index e52da3b..21b911b 100755 --- a/frontend/src/ketr-photos/ketr-photos.html +++ b/frontend/src/ketr-photos/ketr-photos.html @@ -452,7 +452,8 @@ observers: [ "widthChanged(calcWidth)", "modeChanged(mode)", - "dateChanged(date)" + "dateChanged(date)", + "userChanged(user)" ], disableLogin: function(username, password) { @@ -532,7 +533,9 @@ return; } - this.user = user; + if (user && user.username) { + this.user = user; + } }.bind(this), null, "POST", { u: this.username, p: this.password }); }, @@ -1144,8 +1147,11 @@ userChanged: function(user) { this.resetPhotos(); if (user) { + this.mode = "memories"; this._loadAlbums(); this._loadPhotos(); + } else { + this.mode = "login"; } }, @@ -1187,7 +1193,6 @@ if (results && results.username) { this.user = results; - this.mode = "memories"; } }.bind(this));