From f49f7b2c9bb9581246a53bb447bb7dad0e538ee1 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Fri, 15 Nov 2024 16:48:02 +0100 Subject: [PATCH] fix live timer after reload --- resources/js/utils/useCurrentTimeEntry.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/js/utils/useCurrentTimeEntry.ts b/resources/js/utils/useCurrentTimeEntry.ts index 70713c99..7b18fbc3 100644 --- a/resources/js/utils/useCurrentTimeEntry.ts +++ b/resources/js/utils/useCurrentTimeEntry.ts @@ -66,6 +66,12 @@ export const useCurrentTimeEntryStore = defineStore('currentTimeEntry', () => { if (timeEntriesResponse?.data) { if (timeEntriesResponse.data) { currentTimeEntry.value = timeEntriesResponse.data; + if ( + currentTimeEntry.value.start !== '' && + currentTimeEntry.value.end === null + ) { + startLiveTimer(); + } } else { currentTimeEntry.value = { ...emptyTimeEntry }; }