mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-23 20:36:21 +03:00
Compare commits
2 commits
c93062229d
...
ac41dc7dd4
Author | SHA1 | Date | |
---|---|---|---|
ac41dc7dd4 | |||
238af9ad69 |
2 changed files with 2 additions and 10 deletions
|
@ -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.
|
- [ ] 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
|
||||||
|
|
||||||
|
|
|
@ -18,17 +18,7 @@
|
||||||
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"));
|
||||||
|
@ -36,6 +26,7 @@ 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();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue