Compare commits

..

No commits in common. "ac41dc7dd4c23105f4509db8115903b6d2d807a8" and "c93062229dcc29c143f647449c38cd40e216d467" have entirely different histories.

2 changed files with 10 additions and 2 deletions

View file

@ -29,7 +29,6 @@
- [ ] 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. - [ ] 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) - [x] Maintaining statistics on sent notes, the number of notes received, number of deleted notes (#8)
- [ ] Encrypting notes in the database - [ ] Encrypting notes in the database
- [x] Local notes id is incremental instead of uuidv4 (238af9ad6957f72439a1a39f32662145dd2bdce8)
# AnoPaper v1.0.0 # AnoPaper v1.0.0

View file

@ -18,7 +18,17 @@
import { Navigate } from "react-router-dom"; import { Navigate } from "react-router-dom";
import { timestamp2text } from "../components/utils"; 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() { function Save() {
let id = uuidv4();
let name = localStorage.getItem("NoteName"); let name = localStorage.getItem("NoteName");
let text = localStorage.getItem("NoteText"); let text = localStorage.getItem("NoteText");
let pubTime = Number(localStorage.getItem("NotePubTime")); let pubTime = Number(localStorage.getItem("NotePubTime"));
@ -26,7 +36,6 @@ function Save() {
if (!name || !text) return <Navigate to={`/notes`} replace={true} />; if (!name || !text) return <Navigate to={`/notes`} replace={true} />;
let notesObj = localStorage.getObj("Notes"); let notesObj = localStorage.getObj("Notes");
let id = Object.keys(notesObj).length;
let time = Date.now(); let time = Date.now();