From 4380488815fa9dfe899fbacf71f5e0848544dd37 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 24 Nov 2017 01:24:24 +0100 Subject: fix deep linking --- StoneIsland/www/js/lib/account/AccountView.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'StoneIsland/www/js/lib/account/AccountView.js') diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js index 73637cd1..04dfa828 100755 --- a/StoneIsland/www/js/lib/account/AccountView.js +++ b/StoneIsland/www/js/lib/account/AccountView.js @@ -3,13 +3,13 @@ var AccountView = View.extend({ initialize: function(){ }, - connect: function(cb){ - auth.init(this.ready.bind(this, cb)) + connect: function(initialLoginPath){ + auth.init(this.ready.bind(this, function(){}, initialLoginPath)) }, - ready: function(cb){ + ready: function(cb, initialLoginPath){ if (auth.logged_in()) { - this.logged_in(cb) + this.logged_in(cb, initialLoginPath) } else { this.logged_out(cb) @@ -88,7 +88,7 @@ var AccountView = View.extend({ cb && cb() }, - logged_in: function(cb){ + logged_in: function(cb, initialLoginPath){ this.listAddresses() this.listCreditCards() $("#nav .login").hide() @@ -127,7 +127,12 @@ var AccountView = View.extend({ }) } else { - app.router.go("account/profile") + if (initialLoginPath) { + app.router.go(initialLoginPath) + } + else { + app.router.go("account/profile") + } app.curtain.hide("loading") } }, -- cgit v1.2.3-70-g09d2