refac
This commit is contained in:
1 parent
b74c144c96
commit
2a45fa04cb
1 file changed
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import { createEventDispatcher, onMount, getContext, tick } from 'svelte';
|
import { createEventDispatcher, onMount, getContext, tick } from 'svelte';
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { getModels as _getModels } from '$lib/apis';
|
import { getModels as _getModels } from '$lib/apis';
|
||||||
import type { Writable } from 'svelte/store';
|
import type { Writable } from 'svelte/store';
|
||||||
import type { i18n as i18nType } from 'i18next';
|
import type { i18n as i18nType } from 'i18next';
|
||||||
@@ -102,7 +103,7 @@
|
|||||||
const addTerminalConnection = (server: TerminalConnection) => {
|
const addTerminalConnection = (server: TerminalConnection) => {
|
||||||
terminalConnections = [
|
terminalConnections = [
|
||||||
...terminalConnections,
|
...terminalConnections,
|
||||||
{ ...server, id: server.id ?? crypto.randomUUID() }
|
{ ...server, id: server.id ?? crypto.randomUUID?.() ?? uuidv4() }
|
||||||
];
|
];
|
||||||
saveTerminalServers();
|
saveTerminalServers();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user