mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-02 08:27:29 -08:00
151e60f829
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):
14 lines
341 B
TypeScript
14 lines
341 B
TypeScript
import { useStorage as useStorageComposable } from '@vueuse/core';
|
|
import type { Ref } from 'vue';
|
|
|
|
export function useStorage(key: string): Ref<string | null> {
|
|
const data = useStorageComposable(key, null, undefined, { writeDefaults: false });
|
|
|
|
// bug in 1.15.1
|
|
if (data.value === 'undefined') {
|
|
data.value = null;
|
|
}
|
|
|
|
return data;
|
|
}
|