mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 13:39:44 -08:00
fix(editor): Polyfill crypto.randomUUID (#12052)
This commit is contained in:
parent
a16d006f89
commit
0537524c3e
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import LoadingView from '@/views/LoadingView.vue';
|
||||
import BannerStack from '@/components/banners/BannerStack.vue';
|
||||
import AskAssistantChat from '@/components/AskAssistant/AskAssistantChat.vue';
|
||||
|
@ -17,6 +18,11 @@ import { useSettingsStore } from '@/stores/settings.store';
|
|||
import { useHistoryHelper } from '@/composables/useHistoryHelper';
|
||||
import { useStyles } from './composables/useStyles';
|
||||
|
||||
// Polyfill crypto.randomUUID
|
||||
if (!('randomUUID' in crypto)) {
|
||||
Object.defineProperty(crypto, 'randomUUID', { value: uuid });
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const rootStore = useRootStore();
|
||||
const assistantStore = useAssistantStore();
|
||||
|
|
|
@ -9,7 +9,7 @@ import type { IExecutionFlattedResponse, IExecutionResponse, IRestApiContext } f
|
|||
|
||||
const getBrowserId = () => {
|
||||
let browserId = localStorage.getItem(BROWSER_ID_STORAGE_KEY);
|
||||
if (!browserId && 'randomUUID' in crypto) {
|
||||
if (!browserId) {
|
||||
browserId = crypto.randomUUID();
|
||||
localStorage.setItem(BROWSER_ID_STORAGE_KEY, browserId);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue