always show the running timer in the timers list #5

This commit is contained in:
Jens Kraemer
2021-08-31 14:24:24 +08:00
parent 9802307e5e
commit 6c51ef795a
2 changed files with 9 additions and 2 deletions

View File

@@ -9,8 +9,13 @@ module Stopwatch
end
def is_running_timer?(time_entry)
id = running_time_entry_id
id.present? and time_entry.id == id
end
def running_time_entry_id
timer = Stopwatch::Timer.new(self)
timer.running? and timer.time_entry_id == time_entry.id
timer.time_entry_id if timer.running?
end
end
end