Skip to content

Commit

Permalink
Merge pull request #459 from th0mas/th0mas/timer-start-fix
Browse files Browse the repository at this point in the history
fix: Timer starting from 00:00:00
  • Loading branch information
nelsonic authored Dec 2, 2024
2 parents b5c900f + b9ed35d commit 32bffa8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/app_web/live/app_live.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,13 @@
class="flex flex-col"
x-data="{
start: $refs.timer_start ? $refs.timer_start.innerHTML : null,
current: null,
current: Date.now(),
stop: null,
interval: null
}"
x-init="
start = $refs.timer_start.innerHTML;
current = start;
current = Date.now();
interval = setInterval(() => { current = Date.now(), start = $refs.timer_start ? $refs.timer_start.innerHTML : null }, 500)
"
>
Expand Down Expand Up @@ -524,7 +524,6 @@
x-text="timer_text(start, current || stop)"
class="text-sm font-mono font-semibold text-right mr-1"
>
00:00:00
</span>
</p>
</div>
Expand Down

0 comments on commit 32bffa8

Please sign in to comment.