Skip to content

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

perf: don't refresh notes on every note change

thecodrrc07fe7af55e6
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index 0e640b566..959464ac7 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -124,7 +124,6 @@ class EditorStore extends BaseStore {
.then(async (id) => {
let note = db.notes.note(id)?.data;
if (!note) {
- noteStore.refresh();
this.set((state) => (state.session.isSaving = false));
return;
}
@@ -159,7 +158,9 @@ class EditorStore extends BaseStore {
db.attachments.ofNote(note.id, "files") || [];
});
- noteStore.refresh();
+ if (note.headline !== session.headline || note.title !== session.title)
+ noteStore.refresh();
+
if (!oldSession?.id) {
hashNavigate(`/notes/${id}/edit`, { replace: true });
}