summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/_router.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-10-03 05:29:35 +0200
committerJules Laplace <julescarbon@gmail.com>2018-10-03 05:29:35 +0200
commit21b41e6c7cbde9d60e8e99dfce8331c218068052 (patch)
tree4cc513245f2e0b822c9083b2d2e30556894d3709 /StoneIsland/platforms/android/assets/www/js/lib/_router.js
parent58eb0a78f6c0e717278a2ac2e00ef2afa2cbea2b (diff)
buildl
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/_router.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/_router.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/_router.js b/StoneIsland/platforms/android/assets/www/js/lib/_router.js
index 91f29b55..75f598e9 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/_router.js
+++ b/StoneIsland/platforms/android/assets/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
}