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

@ -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

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,