summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/sdk/auth.js
diff options
context:
space:
mode:
authorRene Ae <aehtyb@gmail.com>2015-11-30 15:24:27 -0600
committerRene Ae <aehtyb@gmail.com>2015-11-30 15:24:27 -0600
commit9d0e54228c79d151c30c527ea83efa7479793686 (patch)
tree3baf83427cd61cb1994e8551eefba5cd21d1a65b /StoneIsland/platforms/ios/www/js/sdk/auth.js
parentb208cb0283c23d68e8013c0dd5ddd4e5e6df8950 (diff)
parentd26e72aea3b3127c95c5ba7069c95f73cf52a2fd (diff)
Merge branch 'master' of https://github.com/okfocus/stone-island
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/sdk/auth.js')
-rw-r--r--StoneIsland/platforms/ios/www/js/sdk/auth.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/StoneIsland/platforms/ios/www/js/sdk/auth.js b/StoneIsland/platforms/ios/www/js/sdk/auth.js
index 8a72dd46..87ce60ea 100644
--- a/StoneIsland/platforms/ios/www/js/sdk/auth.js
+++ b/StoneIsland/platforms/ios/www/js/sdk/auth.js
@@ -95,15 +95,20 @@ var auth = sdk.auth = (function(){
auth.add_deferred_product_to_cart = function(cb){
// auth.deferred_product
if (! auth.deferred_product) {
+ console.log("VV NO DEF PROD")
cb && cb()
return
}
sdk.cart.add_item({
data: auth.deferred_product,
success: function(){
- console.log("ADDED")
+ console.log("ADDED ITEM")
cb && cb()
- }
+ },
+ error: function(data){
+ console.log("ERROR ADDING ITEM", data)
+ cb && cb()
+ },
})
auth.deferred_product = null
app.header.increment_cart_count()
@@ -112,13 +117,12 @@ var auth = sdk.auth = (function(){
auth.log_out = function(){
auth.clear_user()
auth.clear_cart()
- auth.view_logged_out()
}
auth.logged_in = function(){
- return (auth.user_id !== -1) && (auth.user_id !== "undefined")
+ return (auth.user_id && auth.user_id !== -1 && auth.user_id !== "undefined")
}
auth.has_cart = function(){
- return (sdk.cart.id !== -1) && (sdk.cart.id !== "undefined")
+ return (sdk.cart.id && sdk.cart.id !== -1 && sdk.cart.id !== "undefined")
}
return auth