Skip to content

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

fix: crash when saving with Ctrl+S

thecodrrf9d45e4adf3d
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index 084cd6d8f..dc15d072a 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -114,8 +114,9 @@ function editorStore(set, get) {
: db.notes.add.bind(db.notes);
func(note).then(id => {
- if (oldSession.tags.length !== tags.length) updateContext("tags", tags);
- if (oldSession.colors.length !== colors.length) {
+ if (!oldSession || oldSession.tags.length !== tags.length)
+ updateContext("tags", tags);
+ if (!oldSession || oldSession.colors.length !== colors.length) {
updateContext("colors", colors);
appStore.getState().refreshColors();
}