summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-25 04:19:11 -0500
committerJules Laplace <jules@okfoc.us>2015-11-25 04:19:11 -0500
commitceb49ed31441923f84795bbf5242c4c3252698ee (patch)
tree7698734210cb770c8b0d955818951ec534abafd9 /StoneIsland/www/js
parentf0c551933c5e725b980014b559d757bee99d0536 (diff)
fix auth bugs pt 2
Diffstat (limited to 'StoneIsland/www/js')
-rw-r--r--StoneIsland/www/js/lib/account/AccountView.js26
1 files changed, 18 insertions, 8 deletions
diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js
index ddca9666..86c02056 100644
--- a/StoneIsland/www/js/lib/account/AccountView.js
+++ b/StoneIsland/www/js/lib/account/AccountView.js
@@ -39,22 +39,32 @@ var AccountView = View.extend({
})
$("#nav .login").hide()
$("#nav .account, #nav .logout").show()
- if (app.last_view && app.last_view != app.login && app.last_view != app.signin && app.last_view != app.logout) {
- app.view && app.view.hide && app.view.hide()
- app.view = app.last_view
- app.view.show()
+ if (! auth.deferred_product && app.last_view) {
+ if (app.last_view != app.login && app.last_view != app.signin && app.last_view != app.logout) {
+ app.view && app.view.hide && app.view.hide()
+ app.view = app.last_view
+ app.view.show()
+ }
}
else {
cb && cb()
}
if ( ! auth.has_cart() ) {
- console.log("VV make cart")
- auth.create_cart(auth.add_deferred_product_to_cart)
+ app.curtain.show("loading")
+ auth.create_cart(function(){
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ setTimeout(function(){
+ app.curtain.hide("loading")
+ }, 500)
+ })
+ })
}
else {
if (auth.deferred_product) {
- console.log("VV got def prod", auth.deferred_product)
- auth.add_deferred_product_to_cart()
+ auth.add_deferred_product_to_cart(function(){
+ app.router.go("cart")
+ })
}
else {
app.cart.load()