fix: note ids

This commit is contained in:
Artemy Egorov 2023-05-05 18:41:14 +03:00
parent cbc1e65fa1
commit 0f25c8173b
2 changed files with 3 additions and 4 deletions

View file

@ -26,12 +26,11 @@ function Save() {
if (!name || !text) return <Navigate to={`/notes`} replace={true} />;
let notesObj = localStorage.getObj("Notes");
let id = Object.keys(notesObj).length;
let time = Date.now();
notesObj[id] = {
id,
notesObj[time] = {
id: time,
name,
text,
time,