web: reenable tags refreshing in editor

This commit is contained in:
Abdullah Atta
2024-03-07 13:05:49 +05:00
parent 86ff1890f1
commit 2c4170bacc

View File

@@ -211,16 +211,16 @@ class EditorStore extends BaseStore<EditorStore> {
};
refreshTags = async () => {
// const { session } = this.get();
// if (!session.id) return;
// this.set({
// tags: await db.relations
// .to({ id: session.id, type: "note" }, "tag")
// .selector.items(undefined, {
// sortBy: "dateCreated",
// sortDirection: "asc"
// })
// });
const { updateSession, getActiveSession } = this.get();
const session = getActiveSession();
if (!session || !("note" in session)) return;
const tags = await db.relations
.to({ id: session.note.id, type: "note" }, "tag")
.selector.items(undefined, {
sortBy: "dateCreated",
sortDirection: "asc"
});
updateSession(session.id, ["readonly", "default"], { tags });
};
refresh = async () => {