cleanup dayjs abstraction usage and useCurrentTimeEntry api for starting and stopping time entries

This commit is contained in:
Gregor Vostrak
2024-09-29 00:02:53 +02:00
parent a6528102fe
commit 878bbd359d
4 changed files with 8 additions and 11 deletions

View File

@@ -42,14 +42,14 @@ const loadMoreContainer = ref<HTMLDivElement | null>(null);
const isLoadMoreVisible = useElementVisibility(loadMoreContainer);
const currentTimeEntryStore = useCurrentTimeEntryStore();
const { currentTimeEntry } = storeToRefs(currentTimeEntryStore);
const { stopTimer } = currentTimeEntryStore;
const { setActiveState } = currentTimeEntryStore;
const { tags } = storeToRefs(useTagsStore());
async function startTimeEntry(
timeEntry: Omit<CreateTimeEntryBody, 'member_id'>
) {
if (currentTimeEntry.value.id) {
await stopTimer();
await setActiveState(false);
}
await createTimeEntry(timeEntry);
fetchTimeEntries();