fix: Stop showing mapping hint after mapping (#5586)

* fix: Stop showing mapping hint after mapping

* fix: set value correctly

* chore: clean up mapping hint code
This commit is contained in:
Mutasem Aldmour
2023-03-01 14:02:34 +03:00
committed by GitHub
parent aa2beaa800
commit eac4275a7e
7 changed files with 13 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
import { STORES } from '@/constants';
import { LOCAL_STORAGE_MAPPING_IS_ONBOARDED, STORES } from '@/constants';
import { INodeUi, IRunDataDisplayMode, NDVState, NodePanelType, XYPosition } from '@/Interface';
import { IRunData } from 'n8n-workflow';
import { defineStore } from 'pinia';
@@ -40,6 +40,7 @@ export const useNDVStore = defineStore(STORES.NDV, {
canDrop: false,
stickyPosition: null,
},
isMappingOnboarded: window.localStorage.getItem(LOCAL_STORAGE_MAPPING_IS_ONBOARDED) === 'true',
}),
getters: {
activeNode(): INodeUi | null {
@@ -184,5 +185,9 @@ export const useNDVStore = defineStore(STORES.NDV, {
setNDVPanelDataIsEmpty(payload: { panel: 'input' | 'output'; isEmpty: boolean }): void {
Vue.set(this[payload.panel].data, 'isEmpty', payload.isEmpty);
},
disableMappingHint() {
this.isMappingOnboarded = true;
window.localStorage.setItem(LOCAL_STORAGE_MAPPING_IS_ONBOARDED, 'true');
},
},
});