diff --git a/src/lib/TaskItem.svelte b/src/lib/TaskItem.svelte index cf615d7..c12897e 100644 --- a/src/lib/TaskItem.svelte +++ b/src/lib/TaskItem.svelte @@ -29,9 +29,9 @@ let hourInput = $state(0); let minuteInput = $state(0); let secondsInput = $state(0); + let inputDuration = $derived((hourInput * 360) + (minuteInput * 60) + secondsInput); function handleTimeSubmit() { - const inputDuration = (hourInput * 360) + (minuteInput * 60) + secondsInput; if (selectedTab === "set") { task.duration = inputDuration; } @@ -43,6 +43,7 @@
+
+

+ {formatSecondsToDuration(task.duration)} ➜ + {#if selectedTab === "set"} + {formatSecondsToDuration(inputDuration)} + {:else if selectedTab === "add"} + {formatSecondsToDuration(task.duration + inputDuration)} + {/if} +

@@ -84,7 +93,6 @@