From 7b3362901952b4de30c95df59f6ede09fa23d966 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Mon, 23 Oct 2023 17:17:13 +0300 Subject: [PATCH] Update widgets-bundle-widgets.component.ts --- .../home/pages/widget/widgets-bundle-widgets.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle-widgets.component.ts b/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle-widgets.component.ts index 4b369add8d..cc54c53901 100644 --- a/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle-widgets.component.ts +++ b/ui-ngx/src/app/modules/home/pages/widget/widgets-bundle-widgets.component.ts @@ -205,14 +205,16 @@ export class WidgetsBundleWidgetsComponent extends PageComponent implements OnIn const isExistWidget = this.widgets.some(widget => widget.id.id === widgetType.id.id); if (isExistWidget) { this.widgets = this.widgets.map(widget => widget.id.id !== widgetType.id.id ? widget : widgetType); - } else { - this.widgets.push(widgetType); } if (this.editMode) { + this.widgets.push(widgetType); this.isDirty = true; this.cd.markForCheck(); } else if (!isExistWidget) { - this.widgetsService.addWidgetFqnToWidgetBundle(this.widgetsBundle.id.id, widgetType.fqn).subscribe(() => {}); + this.widgetsService.addWidgetFqnToWidgetBundle(this.widgetsBundle.id.id, widgetType.fqn).subscribe(() => { + this.widgets.push(widgetType); + this.cd.markForCheck(); + }); } } }