From e279e6c983158ae8b7c03b548163bd2ffa1e3710 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Tue, 24 May 2022 11:31:07 +1000 Subject: Skip tutorial if page recently visited --- src/App.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index a59d4ee..960459c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -108,8 +108,8 @@ export default defineComponent({ helpOpen: false, searchOpen: false, settingsOpen: false, - tutorialOpen: true, - welcomeOpen: true, + tutorialOpen: localStorage.getItem('visited') == null, + welcomeOpen: localStorage.getItem('visited') == null, disabledActions: new Set(), tutTriggerAction: null as Action | null, tutTriggerFlag: false, @@ -686,11 +686,15 @@ export default defineComponent({ }, }, created(){ + // Event listeners window.addEventListener('resize', this.onResize); window.addEventListener('keyup', this.onKeyUp); + // Layout initialisation tryLayout(this.activeRoot, this.tileAreaPos, this.tileAreaDims, this.lytOpts, {allowCollapse: true, layoutMap: this.layoutMap}); this.initTreeFromServer(); + // Remember if page recently visited + localStorage.setItem('visited', 'yes'); }, unmounted(){ window.removeEventListener('resize', this.onResize); -- cgit v1.2.3