diff --git a/changelog.md b/changelog.md index 2d12d75..b6756e5 100644 --- a/changelog.md +++ b/changelog.md @@ -29,7 +29,7 @@ - [ ] Settings for publish notes, such as: delete after reading, number of reads before deleting, adding your own data (name, picture, status in the settings) to the note. - [x] Maintaining statistics on sent notes, the number of notes received, number of deleted notes (#8) - [ ] Encrypting notes in the database -- [x] Local notes id is incremental instead of uuidv4 (238af9ad6957f72439a1a39f32662145dd2bdce8) +- [x] Local notes ids is ~~incremental~~ `Date.now()` instead of uuidv4 (238af9ad6957f72439a1a39f32662145dd2bdce8) # AnoPaper v1.0.0 diff --git a/src/pages/save-local.jsx b/src/pages/save-local.jsx index a1d7f2c..ad7bfd5 100644 --- a/src/pages/save-local.jsx +++ b/src/pages/save-local.jsx @@ -26,12 +26,11 @@ function Save() { if (!name || !text) return ; 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,