Skip to content

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

web: always sort pinned tabs first

Abdullah Attae39be83f7036
diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts
index 8245e7b44..b86e22f5d 100644
--- a/apps/web/src/stores/editor-store.ts
+++ b/apps/web/src/stores/editor-store.ts
@@ -446,6 +446,9 @@ class EditorStore extends BaseStore<EditorStore> {
} else if (activeSessionIndex > -1)
state.sessions.splice(activeSessionIndex + 1, 0, session);
else state.sessions.push(session);
+ state.sessions.sort((a, b) =>
+ a.pinned === b.pinned ? 0 : a.pinned ? -1 : 1
+ );
});
const { history } = this.get();