diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-23 04:54:04 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-23 04:54:04 -0500 |
| commit | 69890f479cc9dc22bdf0a6a765135dfe9a98416c (patch) | |
| tree | 438546edb34304f19d7e92017112ee5cbdcb3bca /StoneIsland/www/js/lib/account/AccountView.js | |
| parent | 8e627ed25ae70556b839f00990ba700ccdb3a719 (diff) | |
prefetch cart
Diffstat (limited to 'StoneIsland/www/js/lib/account/AccountView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/account/AccountView.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/account/AccountView.js b/StoneIsland/www/js/lib/account/AccountView.js index c6f68e88..e9022d64 100644 --- a/StoneIsland/www/js/lib/account/AccountView.js +++ b/StoneIsland/www/js/lib/account/AccountView.js @@ -47,8 +47,16 @@ var AccountView = View.extend({ else { cb && cb() } - if (auth.deferred_product) { - auth.add_deferred_product_to_cart() + if ( ! auth.has_cart() ) { + auth.create_cart(auth.add_deferred_product_to_cart) + } + else { + if (auth.deferred_product) { + auth.add_deferred_product_to_cart( app.cart.load.bind(app.cart) ) + } + else { + app.cart.load() + } } }, |
