Skip to content

Commit

Permalink
fix live timer after reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Nov 15, 2024
1 parent 9e77500 commit f49f7b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resources/js/utils/useCurrentTimeEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
Expand Down

0 comments on commit f49f7b2

Please sign in to comment.