summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/lib/account
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/account
parent28b7ef196eaca6b9e455846cf6233bbabd9e4513 (diff)
do everything we can to force lockout
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/account')
-rwxr-xr-xStoneIsland/platforms/ios/www/js/lib/account/AccountView.js4
-rw-r--r--StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js11
2 files changed, 11 insertions, 4 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js b/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js
index 4605416c..8ac7c193 100755
--- a/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/AccountView.js
@@ -105,6 +105,7 @@ var AccountView = View.extend({
cb && cb()
}
console.log('logged in')
+ app.account.consent.check()
if ( ! auth.has_cart() ) {
console.log('no cart')
app.curtain.show("loading")
@@ -132,9 +133,10 @@ var AccountView = View.extend({
console.log("navigating to deep link route from logged_in")
app.router.go(initialLoginPath)
}
- else {
+ else if (!app.last_view) {
app.router.go("account/profile")
}
+ app.account.consent.check()
app.curtain.hide("loading")
}
},
diff --git a/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js b/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js
index dfeb4fac..c9235498 100644
--- a/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js
+++ b/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js
@@ -18,11 +18,14 @@ var ConsentModal = View.extend({
check: function(){
var status = localStorage.getItem('account_terms.consent')
+ console.log('account_terms.consent', status)
if (status !== 'true') {
+ console.log('we demand consent!')
app.demand_consent = true
this.show()
return true
} else {
+ console.log('already received consent!')
this.hide()
app.demand_consent = false
return false
@@ -35,8 +38,10 @@ var ConsentModal = View.extend({
setTimeout(function(){
this.$el.addClass('visible')
}.bind(this), 20)
- app.curtain.show()
- app.curtain.classList.add('opaque')
+ app.curtain.show('opaque')
+ setTimeout(function(){
+ app.curtain.show('opaque')
+ }, 300)
},
hide: function(){
@@ -44,7 +49,7 @@ var ConsentModal = View.extend({
this.$el.removeClass('visible')
setTimeout(function(){
this.$el.hide()
- app.curtain.classList.remove('opaque')
+ app.curtain.$el.removeClass('opaque')
}.bind(this), 300)
},