Skip to content

Commit

Permalink
start time entry on click in recently tracked time entries dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Feb 6, 2025
1 parent db7111d commit 31b9659
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions resources/js/packages/ui/src/TimeTracker/TimeTrackerControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,17 @@ function updateProject() {
emit('updateTimeEntry');
}
function setAndStartTimer(timeEntry: TimeEntry) {
setCurrentTimeEntry(timeEntry);
if (!props.isActive) {
emit('startTimer');
}
else {
emit('updateTimeEntry');
}
}
function setCurrentTimeEntry(timeEntry: TimeEntry){
console.log('asdasd')
currentTimeEntry.value.description = timeEntry.description;
currentTimeEntry.value.project_id = timeEntry.project_id;
currentTimeEntry.value.task_id = timeEntry.task_id;
Expand Down Expand Up @@ -198,7 +207,7 @@ useSelectEvents(filteredRecentlyTrackedTimeEntries,
:highlighted="highlightedDropdownEntryId === timeEntry.id"
:projects="projects"
:tasks="tasks"
@mousedown="setCurrentTimeEntry(timeEntry)"
@mousedown="setAndStartTimer(timeEntry)"
@mouseenter="highlightedDropdownEntryId = timeEntry.id"
></TimeTrackerRecentlyTrackedEntry>
</div>
Expand Down

0 comments on commit 31b9659

Please sign in to comment.