Remove dependency on uuid package, and use crypto.randomUUID() instead

This commit is contained in:
Alejandro Celaya
2024-10-02 12:06:22 +02:00
parent a90ef56eb8
commit 69344a01ac
6 changed files with 14 additions and 37 deletions

View File

@@ -4,7 +4,6 @@ import type { FC } from 'react';
import { useCallback, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { Button } from 'reactstrap';
import { v4 as uuid } from 'uuid';
import { NoMenuLayout } from '../common/NoMenuLayout';
import type { FCWithDeps } from '../container/utils';
import { componentFactory, useDependencies } from '../container/utils';
@@ -45,7 +44,7 @@ const CreateServer: FCWithDeps<CreateServerProps, CreateServerDeps> = ({ servers
const [isConfirmModalOpen, toggleConfirmModal] = useToggle();
const [serverData, setServerData] = useState<ServerData>();
const saveNewServer = useCallback((theServerData: ServerData) => {
const id = uuid();
const id = crypto.randomUUID();
createServers([{ ...theServerData, id }]);
navigate(`/server/${id}`);