diff --git a/src/App.tsx b/src/App.tsx index c13b5ff5..6733a17d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,7 +4,7 @@ import SideBar from "components/SideBar"; import Board from "components/Board"; import { MdVisibilityOff } from "react-icons/md"; import { useMediaQuery } from "react-responsive"; -import { Collapse } from "@chakra-ui/react"; +import { Collapse } from "@chakra-ui/react"; function App() { const [showSidebar,setShowSidebar] = useState(false); diff --git a/src/components/Board/AddTask.tsx b/src/components/Board/AddTask.tsx index dfaaf4ed..76278019 100644 --- a/src/components/Board/AddTask.tsx +++ b/src/components/Board/AddTask.tsx @@ -8,6 +8,8 @@ import { appData, addTask, editTask, deleteTask } from "redux/boardSlice"; import { useDispatch, useSelector } from "react-redux"; import { checkDuplicatedTask } from "utilis"; import { useToast } from "@chakra-ui/react"; +import { v4 as uuidv4 } from "uuid"; +import { uuid } from "uuidv4"; const generateRandomNumber = (): string => { return String(Math.floor(Math.random() * (9999 - 9000 + 1)) + 9000); @@ -152,7 +154,7 @@ export default function AddTask({ handleClose, tasks }: Props) { type="button" onClick={() => { arrayHelpers.push({ - id: generateRandomNumber(), + id: uuidv4(), title: "", isCompleted: false, });