diff options
Diffstat (limited to 'desktop/island/calendar/Calendar.qml')
| -rw-r--r-- | desktop/island/calendar/Calendar.qml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/desktop/island/calendar/Calendar.qml b/desktop/island/calendar/Calendar.qml index f215021..4a5e7d4 100644 --- a/desktop/island/calendar/Calendar.qml +++ b/desktop/island/calendar/Calendar.qml @@ -51,10 +51,11 @@ Singleton { }); } - function get(uid, cb) { root.run(["get", uid], cb); } + // `cal` is the calendar the event is in now: one UID can be in two. + function get(uid, cal, cb) { root.run(["get", uid, cal], cb); } function create(event, cb) { root.run(["new", JSON.stringify(event)], cb); } - function update(uid, event, cb) { root.run(["edit", uid, JSON.stringify(event)], cb); } - function remove(uid, cb) { root.run(["delete", uid], cb); } + function update(uid, cal, event, cb) { root.run(["edit", uid, cal, JSON.stringify(event)], cb); } + function remove(uid, cal, cb) { root.run(["delete", uid, cal], cb); } // One Process per call, so a list and a save never share one (a running // Process ignores a second start, AGENTS.md). cb gets calctl's envelope. @@ -72,8 +73,8 @@ Singleton { let r; try { r = JSON.parse(text); } catch (e) { r = { ok: false, error: "calctl: " + (text.trim() || "no output") }; } - if (proc.cb) proc.cb(r); - proc.destroy(); + try { if (proc.cb) proc.cb(r); } + finally { proc.destroy(); } } } } |
