Skip to content

Commit e893cc4

Browse files
committed
refactor: TTL-1060 add timeout to restart dispatch
1 parent 8c2df12 commit e893cc4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/app/modules/time-entries/pages/time-entries.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,17 @@ export class TimeEntriesComponent implements OnInit, OnDestroy, AfterViewInit {
177177
}
178178
});
179179
}
180-
doSave(event: SaveEntryEvent) {
180+
181+
async doSave(event: SaveEntryEvent) {
181182
if (this.entryId) {
182183
event.entry.id = this.entryId;
184+
183185
this.store.dispatch(new entryActions.UpdateEntry(event.entry));
186+
184187
if (event.shouldRestartEntry) {
185-
this.store.dispatch(new entryActions.RestartEntry(event.entry));
188+
setTimeout(
189+
() => (this.store.dispatch(new entryActions.RestartEntry(event.entry))), 300
190+
);
186191
}
187192
} else {
188193
this.store.dispatch(new entryActions.CreateEntry(event.entry));

0 commit comments

Comments
 (0)