Skip to content

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

fix: refresh editor on syncing

thecodrrc24228ce1b9d
diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js
index ced87a3a9..9eb6cbaf4 100644
--- a/apps/web/src/stores/app-store.js
+++ b/apps/web/src/stores/app-store.js
@@ -3,6 +3,7 @@ import { db } from "../common";
import { store as noteStore } from "./note-store";
import { store as notebookStore } from "./notebook-store";
import { store as trashStore } from "./trash-store";
+import { store as editorStore } from "./editor-store";
import { store as tagStore } from "./tag-store";
import BaseStore from "./index";
@@ -12,11 +13,12 @@ class AppStore extends BaseStore {
isFocusMode = false;
colors = [];
- refresh = () => {
+ refresh = async () => {
noteStore.refresh();
notebookStore.refresh();
trashStore.refresh();
tagStore.refresh();
+ await editorStore.openLastSession();
this.refreshColors();
};
diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js
index b8b6adfce..db2b7965c 100644
--- a/apps/web/src/stores/user-store.js
+++ b/apps/web/src/stores/user-store.js
@@ -52,8 +52,8 @@ class UserStore extends BaseStore {
.then(() => {
appStore.refresh();
})
- .catch((err) => {
- if (err.code === "MERGE_CONFLICT") appStore.refresh();
+ .catch(async (err) => {
+ if (err.code === "MERGE_CONFLICT") await appStore.refresh();
else console.error(err);
})
.finally(() => {
@@ -62,12 +62,12 @@ class UserStore extends BaseStore {
};
logout = () => {
- db.user.logout().then(() => {
+ db.user.logout().then(async () => {
this.set((state) => {
state.user = undefined;
state.isLoggedIn = false;
});
- appStore.refresh();
+ await appStore.refresh();
});
};
}
diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock
index 88a909f93..3c49df1c5 100644
--- a/apps/web/yarn.lock
+++ b/apps/web/yarn.lock
@@ -6910,7 +6910,7 @@ normalize-url@^3.0.0, normalize-url@^3.0.1:
"notes-core@git+ssh://[email protected]:thecodrr/notes-core.git":
version "1.2.0"
- resolved "git+ssh://[email protected]:thecodrr/notes-core.git#069226c64718e4c4eb0e773a7c613db8435b65a8"
+ resolved "git+ssh://[email protected]:thecodrr/notes-core.git#3974ae93daf2bdc3da7b286fb66b34015c076bef"
dependencies:
fast-sort "^2.0.1"
fuzzysearch "^1.0.3"