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:
Mutasem Aldmour
2023-11-07 10:06:08 +01:00
committed by GitHub
parent 78b84af8d1
commit 151e60f829
12 changed files with 97 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
import { defineComponent } from 'vue';
import { mapStores } from 'pinia';
import { useStorage } from '@vueuse/core';
import { useStorage } from '@/composables/useStorage';
import { externalHooks } from '@/mixins/externalHooks';
import { workflowHelpers } from '@/mixins/workflowHelpers';
@@ -120,10 +120,7 @@ export const workflowActivate = defineComponent({
this.updatingWorkflowActivation = false;
if (isCurrentWorkflow) {
if (
newActiveState &&
useStorage(LOCAL_STORAGE_ACTIVATION_FLAG, undefined).value !== 'true'
) {
if (newActiveState && useStorage(LOCAL_STORAGE_ACTIVATION_FLAG).value !== 'true') {
this.uiStore.openModal(WORKFLOW_ACTIVE_MODAL_KEY);
} else {
await this.settingsStore.fetchPromptsData();