Browse Source

UI-1926: Re-organized walkthroughs for trial/non-trial accounts

4.3
Jean-Roch Maitre 10 years ago
parent
commit
e12c6917a9
1 changed files with 28 additions and 6 deletions
  1. +28
    -6
      submodules/myOffice/myOffice.js

+ 28
- 6
submodules/myOffice/myOffice.js View File

@ -10,7 +10,8 @@ define(function(require){
subscribe: {
'voip.myOffice.render': 'myOfficeRender',
'auth.continueTrial': 'myOfficeWalkthroughRender'
'auth.continueTrial': 'myOfficeWalkthroughRender',
'myaccount.closed': 'myOfficeAfterMyaccountClosed'
},
chartColors: [
@ -117,16 +118,37 @@ define(function(require){
.empty()
.append(template);
// If it's not a trial, we show the Walkthrough the first time
// If it's a trial, this code will be called by trial handler
if(!monster.apps.auth.currentAccount.hasOwnProperty('trial_time_left')) {
self.myOfficeWalkthroughRender();
}
self.myOfficeCheckWalkthrough();
callback && callback();
});
},
// we check if we have to display the walkthrough:
// first make sure it's not a trial, then
// only show it if we've already shown the walkthrough in myaccount
myOfficeCheckWalkthrough: function() {
var self = this;
if(!monster.apps.auth.currentAccount.hasOwnProperty('trial_time_left')) {
monster.pub('myaccount.hasToShowWalkthrough', function(response) {
if(response === false) {
self.myOfficeWalkthroughRender();
}
});
}
},
myOfficeAfterMyaccountClosed: function() {
var self = this;
// If it's not a trial, we show the Walkthrough the first time
// because if it's a trial, myOfficeWalkthroughRender will be called by another event
if(!monster.apps.auth.currentAccount.hasOwnProperty('trial_time_left')) {
self.myOfficeWalkthroughRender();
}
},
myOfficeCreateMainVMBoxIfMissing: function(callback) {
var self = this;


Loading…
Cancel
Save