fix(planner): frozen slots when switching between todos (#4944)

Signed-off-by: Eduard Aksamitov <e@euaaaio.ru>
This commit is contained in:
Eduard Aksamitov 2024-03-13 13:29:34 +03:00 committed by GitHub
parent d5b6942f7d
commit 81e8a74d23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<WorkSlot> }>): Promise<void> {
const { startDate, dueDate, slot } = e.detail