Get dependency on uuid package back to fix error on non-secure contexts

This commit is contained in:
Alejandro Celaya
2024-10-09 09:27:08 +02:00
parent 1ba2241203
commit 453d245924
7 changed files with 48 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { randomUUID } from '../../utils/utils';
import type { ServerData, ServersMap, ServerWithId } from '../data';
interface EditServer {
@@ -19,7 +20,7 @@ const serverWithId = (server: ServerWithId | ServerData): ServerWithId => {
return server;
}
return { ...server, id: crypto.randomUUID() };
return { ...server, id: randomUUID() };
};
const serversListToMap = (servers: ServerWithId[]): ServersMap => servers.reduce<ServersMap>(