summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/_router.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-10-03 03:08:25 +0200
committerJules Laplace <julescarbon@gmail.com>2018-10-03 03:08:25 +0200
commit58eb0a78f6c0e717278a2ac2e00ef2afa2cbea2b (patch)
treeb1d64c03a9fddf3037561c1d2d42751fbc011533 /StoneIsland/platforms/ios/www/js/lib/_router.js
parent28b7ef196eaca6b9e455846cf6233bbabd9e4513 (diff)
do everything we can to force lockout
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/_router.js')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/_router.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js
index 91f29b55..75f598e9 100755
--- a/StoneIsland/platforms/ios/www/js/lib/_router.js
+++ b/StoneIsland/platforms/ios/www/js/lib/_router.js
@@ -40,7 +40,14 @@ var SiteRouter = Router.extend({
'/cart/error': 'cart.error',
},
- terms_routes: ['terms','account_terms','privacy','returns','care','logout'],
+ terms_routes: [
+ 'terms',
+ 'account_terms',
+ 'privacy',
+ 'returns',
+ 'care',
+ 'logout',
+ ],
initialize: function(){
var fn
@@ -105,8 +112,11 @@ var SiteRouter = Router.extend({
// return
// }
- var isTermsRoute = this.terms_routes.indexOf(name) !== -1
- if (app.demand_consent && !isTermsRoute && app.account.consent.check()) {
+ var isNotTermsRoute = this.terms_routes.indexOf(name) === -1
+ var isCartRoute = n[0] === 'cart'
+ var userMightActuallyViewCart = isCartRoute && auth.logged_in()
+ var demandingConsent = app.demand_consent && isNotTermsRoute
+ if ((userMightActuallyViewCart || demandingConsent) && app.account.consent.check()) {
console.log('showed consent modal')
return
}