activating saving tutorial state

This commit is contained in:
Nicolas Constant 2020-09-12 14:12:59 -04:00
parent d46fa0ffca
commit f5f1c2e8f8
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 3 additions and 10 deletions

View File

@ -62,9 +62,6 @@ export class AppComponent implements OnInit, OnDestroy {
} }
ngOnInit(): void { ngOnInit(): void {
// disable tutorial for future update
//localStorage.setItem('tutorial', JSON.stringify(true));
this.paramsSub = this.activatedRoute.queryParams.subscribe(params => { this.paramsSub = this.activatedRoute.queryParams.subscribe(params => {
const code = params['code']; const code = params['code'];
if (!code) { if (!code) {
@ -164,11 +161,7 @@ export class AppComponent implements OnInit, OnDestroy {
enhancedTutorialVisible: boolean; enhancedTutorialVisible: boolean;
private checkEnhancedTutorial() { private checkEnhancedTutorial() {
let enhancedTutorialDesactivated = JSON.parse(localStorage.getItem('tutorial')); let enhancedTutorialDesactivated = JSON.parse(localStorage.getItem('tutorial'));
console.warn(enhancedTutorialDesactivated);
if (!this.floatingColumnActive && !this.tutorialActive && !enhancedTutorialDesactivated) { if (!this.floatingColumnActive && !this.tutorialActive && !enhancedTutorialDesactivated) {
console.warn('load enhanced tutorial');
setTimeout(() => { setTimeout(() => {
this.enhancedTutorialActive = true; this.enhancedTutorialActive = true;
setTimeout(() => { setTimeout(() => {
@ -179,12 +172,12 @@ export class AppComponent implements OnInit, OnDestroy {
} }
closeTutorial(){ closeTutorial(){
console.warn('close tutorial'); localStorage.setItem('tutorial', JSON.stringify(true));
this.enhancedTutorialVisible = false; this.enhancedTutorialVisible = false;
setTimeout(() => { setTimeout(() => {
this.enhancedTutorialActive = false; this.enhancedTutorialActive = false;
}, 400); }, 400);
//localStorage.setItem('tutorial', JSON.stringify(true));
} }
ngOnDestroy(): void { ngOnDestroy(): void {