summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/sdk/auth.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-30 16:14:29 -0500
committerJules Laplace <jules@okfoc.us>2015-11-30 16:14:29 -0500
commit840cdf39595c6b8a29d2c91447d9fb8a91582a59 (patch)
tree76ec09a7693993f7229948a79dace3f268f001ec /StoneIsland/platforms/ios/www/js/sdk/auth.js
parent7920b278e296e99a069c7ab8b78b271e9665a84a (diff)
ui changes
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