From 0630452571c507b8215d8e059fcdb4013f809aa2 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 20 Aug 2021 22:53:15 +0530 Subject: [PATCH] No need to observe Signed-off-by: RMidhunSuresh --- src/domain/RootViewModel.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/domain/RootViewModel.js b/src/domain/RootViewModel.js index 4a0a969e..d6fdcfa0 100644 --- a/src/domain/RootViewModel.js +++ b/src/domain/RootViewModel.js @@ -40,10 +40,9 @@ export class RootViewModel extends ViewModel { } async _applyNavigation(shouldRestoreLastUrl) { - const isLogin = this.navigation.observe("login").get(); - const sessionId = this.navigation.observe("session").get(); - // TODO: why not observe? - const ssoSegment = this.navigation.path.get("sso"); + const isLogin = this.navigation.path.get("login") + const sessionId = this.navigation.path.get("session")?.value; + const loginToken = this.navigation.path.get("sso")?.value; if (isLogin) { if (this.activeSection !== "login") { this._showLogin(); @@ -68,10 +67,10 @@ export class RootViewModel extends ViewModel { this._showSessionLoader(sessionId); } } - } else if (ssoSegment) { + } else if (loginToken) { this.urlCreator.normalizeUrl(); if (this.activeSection !== "login") { - this._showLogin({loginToken: ssoSegment.value}); + this._showLogin(loginToken); } } else { @@ -120,7 +119,7 @@ export class RootViewModel extends ViewModel { this._pendingSessionContainer = sessionContainer; this.navigation.push("session", sessionContainer.sessionId); }, - ...loginToken + loginToken })); }); }