Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

refactor: simplify notes loading

thecodrr7e80078eada4
diff --git a/apps/web/src/views/Home.js b/apps/web/src/views/Home.js
index a26cf2b29..91219dc94 100644
--- a/apps/web/src/views/Home.js
+++ b/apps/web/src/views/Home.js
@@ -8,12 +8,11 @@ import Search from "../components/search";
import Note from "../components/note";
function Home() {
- const [notes, setNotes] = useState([]);
+ const [notes, setNotes] = useState(db.getNotes());
useEffect(() => {
function onRefreshNotes() {
setNotes(db.getNotes());
}
- onRefreshNotes();
ev.addListener("refreshNotes", onRefreshNotes);
return () => {
ev.removeListener("refreshNotes", onRefreshNotes);