web: fix invalid usage of closeSessions

This commit is contained in:
Abdullah Atta
2025-02-24 11:53:18 +05:00
parent 7b2a8c3e20
commit ea7afbe93e

View File

@@ -135,7 +135,10 @@ class AttachmentStore extends BaseStore<AttachmentStore> {
if (await db.attachments.remove(attachment.hash, false)) {
await this.get().refresh();
await useNoteStore.getState().refresh();
useEditorStore.getState().closeSessions(...linkedNotes);
const sessions = linkedNotes
.map((id) => useEditorStore.getState().getSessionsForNote(id))
.flat();
useEditorStore.getState().closeTabs(...sessions.map((s) => s.id));
}
} catch (e) {
console.error(e);