Skip to content

Commit 3951cdb

Browse files
committed
fix: 🐛 correctly await for .deleteEvents()
1 parent 5074725 commit 3951cdb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/plugins/ui_actions/public/actions/dynamic_action_manager.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export class DynamicActionManager {
4141

4242
private stopped: boolean = false;
4343

44+
/**
45+
* UI State of the dynamic action manager.
46+
*/
4447
protected readonly ui = createStateContainer(defaultState, transitions, selectors);
4548

4649
constructor(protected readonly params: DynamicActionManagerParams) {}
@@ -51,6 +54,10 @@ export class DynamicActionManager {
5154
return oldEvent;
5255
}
5356

57+
/**
58+
* We prefix action IDs with a unique `.idPrefix`, so we can render the
59+
* same dashboard twice on the screen.
60+
*/
5461
protected generateActionId(eventId: string): string {
5562
return this.idPrefix + eventId;
5663
}
@@ -214,7 +221,7 @@ export class DynamicActionManager {
214221
* @param eventIds List of event IDs.
215222
*/
216223
public async deleteEvents(eventIds: string[]) {
217-
await eventIds.map(this.deleteEvent.bind(this));
224+
await Promise.all(eventIds.map(this.deleteEvent.bind(this)));
218225
}
219226

220227
/**

0 commit comments

Comments
 (0)