Skip to content

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

fix: new note not respecting current context

thecodrrc041584d5bb0
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index 51973dfca..e1fea2265 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -109,7 +109,7 @@ class EditorStore extends BaseStore {
if (oldSession.colors.length !== this.get().session.colors.length)
appStore.refreshColors();
- if (oldSession.state !== "new" || !oldSession.context) break storeSync;
+ if (!oldSession.context) break storeSync;
const { type, value } = oldSession.context;
if (type === "topic") await db.notes.move(value, id);
@@ -138,8 +138,6 @@ class EditorStore extends BaseStore {
};
newSession = (context = {}) => {
- setHashParam({ note: 0 });
-
this.set(function (state) {
state.session = {
...DEFAULT_SESSION,
@@ -149,6 +147,7 @@ class EditorStore extends BaseStore {
});
saveLastOpenedNote();
noteStore.setSelectedNote(0);
+ setHashParam({ note: 0 });
};
clearSession = () => {
diff --git a/apps/web/src/views/notes.js b/apps/web/src/views/notes.js
index ab0bad6ea..57d72cba3 100644
--- a/apps/web/src/views/notes.js
+++ b/apps/web/src/views/notes.js
@@ -18,6 +18,7 @@ function Notes(props) {
}, [props.context, setContext]);
if (!context) return null;
+
return (
<ListContainer
type="notes"