Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: TTA-206 solve comment of CR
  • Loading branch information
Abigail Cabascango committed Nov 9, 2022
commit 0d39c98f7729ee89f13288530e465649c872252f
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
this.canMarkEntryAsWIP = this.isThereAnEntryRunning(ds.data);
});

if (this.canMarkEntryAsWIP === true ){
if (this.canMarkEntryAsWIP){
this.toastrService.error('There is an existing time entry running please check your time entries');
return;
}
Expand All @@ -134,16 +134,16 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
}, 2000);
}

getEntryRunning(entries: Entry[]) {
private getEntryRunning(entries: Entry[]) {
const runningEntry: Entry = entries.find(entry => entry.running === true);
return runningEntry;
}

isThereAnEntryRunning(entries: Entry[]) {
private isThereAnEntryRunning(entries: Entry[]) {
return !!this.getEntryRunning(entries);
}

updateProject(selectedProject) {
private updateProject(selectedProject) {
const entry = { id: this.activeEntry.id, project_id: selectedProject };
this.store.dispatch(new entryActions.UpdateEntryRunning(entry));
this.store.dispatch(new entryActions.LoadActiveEntry());
Expand Down