mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: fix crash on refreshing editor store
This commit is contained in:
@@ -223,11 +223,15 @@ class EditorStore extends BaseStore<EditorStore> {
|
||||
// });
|
||||
};
|
||||
|
||||
async refresh() {
|
||||
// const sessionId = this.get().session.id;
|
||||
// if (sessionId && !(await db.notes.exists(sessionId)))
|
||||
// await this.clearSession();
|
||||
}
|
||||
refresh = async () => {
|
||||
const { sessions, closeSessions } = this.get();
|
||||
const clearIds = [];
|
||||
for (const session of sessions) {
|
||||
if ("note" in session && !(await db.notes.exists(session.note.id)))
|
||||
clearIds.push(session.id);
|
||||
}
|
||||
if (clearIds.length > 0) closeSessions(...clearIds);
|
||||
};
|
||||
|
||||
updateSession = <T extends SessionType[]>(
|
||||
id: string,
|
||||
|
||||
Reference in New Issue
Block a user