From 81e8a74d23f6c71567c378197fd39851bee0ccc7 Mon Sep 17 00:00:00 2001 From: Eduard Aksamitov Date: Wed, 13 Mar 2024 13:29:34 +0300 Subject: [PATCH] fix(planner): frozen slots when switching between todos (#4944) Signed-off-by: Eduard Aksamitov --- .../src/components/TodoWorkslots.svelte | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/time-resources/src/components/TodoWorkslots.svelte b/plugins/time-resources/src/components/TodoWorkslots.svelte index 2e30339ffb..8128f1477f 100644 --- a/plugins/time-resources/src/components/TodoWorkslots.svelte +++ b/plugins/time-resources/src/components/TodoWorkslots.svelte @@ -24,14 +24,15 @@ import Workslots from './Workslots.svelte' export let todo: ToDo - let slots: WorkSlot[] = [] - - const q = createQuery() - q.query(time.class.WorkSlot, { attachedTo: todo._id }, (res) => { - slots = res - }) const client = getClient() + const query = createQuery() + + let slots: WorkSlot[] = [] + + $: query.query(time.class.WorkSlot, { attachedTo: todo._id }, (res) => { + slots = res + }) async function change (e: CustomEvent<{ startDate: number, dueDate: number, slot: Ref }>): Promise { const { startDate, dueDate, slot } = e.detail