fix(editor): Fix local storage flags defaulting to undefined string (#7603)
useStorage takes the default value `undefined` and sets it in local storage.. also returns "undefined" as string which breaks onboarding flows Github issue / Community forum post (link here to close automatically):
This commit is contained in:
@@ -41,7 +41,7 @@ import { defineComponent } from 'vue';
|
||||
import type { PropType } from 'vue';
|
||||
import { mapStores } from 'pinia';
|
||||
import { get } from 'lodash-es';
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import { useStorage } from '@/composables/useStorage';
|
||||
|
||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
import PanelDragButton from './PanelDragButton.vue';
|
||||
@@ -348,7 +348,6 @@ export default defineComponent({
|
||||
restorePositionData() {
|
||||
const storedPanelWidthData = useStorage(
|
||||
`${LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH}_${this.currentNodePaneType}`,
|
||||
undefined,
|
||||
).value;
|
||||
|
||||
if (storedPanelWidthData) {
|
||||
@@ -362,10 +361,8 @@ export default defineComponent({
|
||||
return false;
|
||||
},
|
||||
storePositionData() {
|
||||
window.localStorage.setItem(
|
||||
`${LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH}_${this.currentNodePaneType}`,
|
||||
this.mainPanelDimensions.relativeWidth.toString(),
|
||||
);
|
||||
useStorage(`${LOCAL_STORAGE_MAIN_PANEL_RELATIVE_WIDTH}_${this.currentNodePaneType}`).value =
|
||||
this.mainPanelDimensions.relativeWidth.toString();
|
||||
},
|
||||
onDragStart() {
|
||||
this.isDragging = true;
|
||||
|
||||
Reference in New Issue
Block a user