From 92651da6a7d1d93e4bd2b04e3a194b7111d32c4b Mon Sep 17 00:00:00 2001 From: Richard Henck <richard.henck@iqb.hu-berlin.de> Date: Wed, 26 Jun 2024 14:24:49 +0200 Subject: [PATCH] [editor] Wait async command to finish before sending unit to Verona-API --- .../editor/src/app/services/unit-services/unit.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/editor/src/app/services/unit-services/unit.service.ts b/projects/editor/src/app/services/unit-services/unit.service.ts index 1524da362..f2baae27e 100644 --- a/projects/editor/src/app/services/unit-services/unit.service.ts +++ b/projects/editor/src/app/services/unit-services/unit.service.ts @@ -90,9 +90,9 @@ export class UnitService { } } - updateUnitDefinition(command?: UnitUpdateCommand): void { + async updateUnitDefinition(command?: UnitUpdateCommand): Promise<void> { if (command) { - const deletedData = command.command(); + const deletedData = await command.command(); if (deletedData instanceof Promise) { deletedData.then((deletedData) => { this.historyService.addCommand(command, deletedData); -- GitLab