Skip to content

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

fix: check if notes need to be reinit if notes length changes

thecodrr8ccfa4ad9b69
diff --git a/apps/web/src/views/home.js b/apps/web/src/views/home.js
index 54c9fbc36..9a87a029b 100644
--- a/apps/web/src/views/home.js
+++ b/apps/web/src/views/home.js
@@ -18,8 +18,8 @@ function Home() {
useEffect(() => {
(async function () {
- const intitialized = db.notes.initialized;
- if (!intitialized || !store.get().notes.length) {
+ const initialized = db.notes.initialized;
+ if (!initialized || !notes.length) {
await db.notes.init();
store.refresh();
setIsLoading(false);
@@ -36,7 +36,7 @@ function Home() {
// await db.notes.add({ id: note.id, conflicted: true, resolved: false });
// console.log(data3);
})();
- }, []);
+ }, [notes.length]);
return (
<ListContainer