summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/sdk/auth.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-23 04:54:04 -0500
committerJules Laplace <jules@okfoc.us>2015-11-23 04:54:04 -0500
commit69890f479cc9dc22bdf0a6a765135dfe9a98416c (patch)
tree438546edb34304f19d7e92017112ee5cbdcb3bca /StoneIsland/www/js/sdk/auth.js
parent8e627ed25ae70556b839f00990ba700ccdb3a719 (diff)
prefetch cart
Diffstat (limited to 'StoneIsland/www/js/sdk/auth.js')
-rw-r--r--StoneIsland/www/js/sdk/auth.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/StoneIsland/www/js/sdk/auth.js b/StoneIsland/www/js/sdk/auth.js
index 65505d81..1fbf48ec 100644
--- a/StoneIsland/www/js/sdk/auth.js
+++ b/StoneIsland/www/js/sdk/auth.js
@@ -86,12 +86,17 @@ var auth = sdk.auth = (function(){
}
})
}
- auth.add_deferred_product_to_cart = function(){
+ auth.add_deferred_product_to_cart = function(cb){
// auth.deferred_product
+ if (! auth.deferred_product) {
+ cb && cb()
+ return
+ }
sdk.cart.add_item({
data: auth.deferred_product,
success: function(){
console.log("ADDED")
+ cb && cb()
}
})
auth.deferred_product = null