Skip to content

Commit 9783d05

Browse files
author
Abigail Cabascango
committed
FIX: TTA-206 validate if there is a time entry running
1 parent 4a69245 commit 9783d05

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
119119
this.store.pipe(select(getTimeEntriesDataSource)).subscribe(ds => {
120120
this.canMarkEntryAsWIP = !this.isThereAnEntryRunning(ds.data);
121121
});
122-
this.store.dispatch(new entryActions.ClockIn(entry));
123-
this.projectsForm.setValue({ project_id: `${customerName} - ${name}` });
124-
setTimeout(() => {
125-
this.store.dispatch(new actions.LoadRecentProjects());
126-
}, 2000);
122+
if ( this.canMarkEntryAsWIP){
123+
this.store.dispatch(new entryActions.ClockIn(entry));
124+
this.projectsForm.setValue({ project_id: `${customerName} - ${name}` });
125+
setTimeout(() => {
126+
this.store.dispatch(new actions.LoadRecentProjects());
127+
}, 2000);
128+
}
127129
}
128130

129131
getEntryRunning(entries: Entry[]) {

0 commit comments

Comments
 (0)