summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorSolstice <solstice@local>2026-06-09 01:10:46 -0700
committerSolstice <solstice@local>2026-06-09 01:10:46 -0700
commit887c0bc6f968f80ac90220f24bb578438e05708a (patch)
tree563925e9bc82ae0eee582dc9128ea753d0082ab0 /src/components
parent4e2d978eb5fc9457d5b913bc10faf1266e6dcda4 (diff)
fix: resolve final release blockers
Diffstat (limited to 'src/components')
-rw-r--r--src/components/TimerView.tsx23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/components/TimerView.tsx b/src/components/TimerView.tsx
index 896c03a..b43973c 100644
--- a/src/components/TimerView.tsx
+++ b/src/components/TimerView.tsx
@@ -54,6 +54,7 @@ export function TimerView() {
const { phase, remainingSecs, totalSecs, running, sessionCount, currentTaskId } =
useTimerStore();
const tasks = useTaskStore((s) => s.tasks);
+ const syncFromBackend = useTimerStore((s) => s.syncFromBackend);
const currentTask = tasks.find((t) => t.id === currentTaskId) ?? null;
@@ -61,10 +62,22 @@ export function TimerView() {
const dashOffset = CIRCUMFERENCE * (1 - progress);
const arcColor = phaseColor(phase);
- const handleStart = () => invoke('start_timer');
- const handlePause = () => invoke('pause_timer');
- const handleSkip = () => invoke('skip_phase');
- const handleReset = () => invoke('reset_timer');
+ const handleStart = async () => {
+ await invoke('start_timer');
+ await syncFromBackend();
+ };
+ const handlePause = async () => {
+ await invoke('pause_timer');
+ await syncFromBackend();
+ };
+ const handleSkip = async () => {
+ await invoke('skip_phase');
+ await syncFromBackend();
+ };
+ const handleReset = async () => {
+ await invoke('reset_timer');
+ await syncFromBackend();
+ };
return (
<div
@@ -200,7 +213,7 @@ function GhostButton({
onClick,
children,
}: {
- onClick: () => void;
+ onClick: () => Promise<void>;
children: React.ReactNode;
}) {
return (