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