fix(editor): Handle localStorage being blocked/unavailable (#7348)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-27 15:51:20 +02:00
committed by GitHub
parent 739a4d4ecf
commit c05bc6728d
10 changed files with 69 additions and 45 deletions

View File

@@ -495,6 +495,7 @@
import { defineAsyncComponent, defineComponent } from 'vue';
import type { PropType } from 'vue';
import { mapStores } from 'pinia';
import { useStorage } from '@vueuse/core';
import { saveAs } from 'file-saver';
import type {
ConnectionTypes,
@@ -975,12 +976,12 @@ export default defineComponent({
return;
}
if (
value &&
value.length > 0 &&
!this.isReadOnlyRoute &&
!localStorage.getItem(LOCAL_STORAGE_PIN_DATA_DISCOVERY_NDV_FLAG)
) {
const pinDataDiscoveryFlag = useStorage(
LOCAL_STORAGE_PIN_DATA_DISCOVERY_NDV_FLAG,
undefined,
).value;
if (value && value.length > 0 && !this.isReadOnlyRoute && !pinDataDiscoveryFlag) {
this.pinDataDiscoveryComplete();
setTimeout(() => {