Compare commits

...

2 commits

Author SHA1 Message Date
ac41dc7dd4 doc: update changelog 2023-05-01 20:21:39 +03:00
238af9ad69 fix: notes ids now incremental 2023-05-01 20:20:54 +03:00
2 changed files with 2 additions and 10 deletions

View file

@ -29,6 +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)
# AnoPaper v1.0.0

View file

@ -18,17 +18,7 @@
import { Navigate } from "react-router-dom";
import { timestamp2text } from "../components/utils";
function uuidv4() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>
(
c ^
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))
).toString(16)
);
}
function Save() {
let id = uuidv4();
let name = localStorage.getItem("NoteName");
let text = localStorage.getItem("NoteText");
let pubTime = Number(localStorage.getItem("NotePubTime"));
@ -36,6 +26,7 @@ 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();