Skip to content

Commit 32bffa8

Browse files
authored
Merge pull request #459 from th0mas/th0mas/timer-start-fix
fix: Timer starting from 00:00:00
2 parents b5c900f + b9ed35d commit 32bffa8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: lib/app_web/live/app_live.html.heex

+2-3
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,13 @@
478478
class="flex flex-col"
479479
x-data="{
480480
start: $refs.timer_start ? $refs.timer_start.innerHTML : null,
481-
current: null,
481+
current: Date.now(),
482482
stop: null,
483483
interval: null
484484
}"
485485
x-init="
486486
start = $refs.timer_start.innerHTML;
487-
current = start;
487+
current = Date.now();
488488
interval = setInterval(() => { current = Date.now(), start = $refs.timer_start ? $refs.timer_start.innerHTML : null }, 500)
489489
"
490490
>
@@ -524,7 +524,6 @@
524524
x-text="timer_text(start, current || stop)"
525525
class="text-sm font-mono font-semibold text-right mr-1"
526526
>
527-
00:00:00
528527
</span>
529528
</p>
530529
</div>

0 commit comments

Comments
 (0)