From b9d4092208c628e6240e167a1e89efe828a820c6 Mon Sep 17 00:00:00 2001 From: mpetrov Date: Fri, 8 Nov 2024 12:22:57 +0200 Subject: [PATCH] Revert "refactoring" This reverts commit 4937976296b87af9aa75e089104c10da00b0bb4c. --- .../dashboard-page/states/dashboard-state-dialog.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/states/dashboard-state-dialog.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/states/dashboard-state-dialog.component.ts index c9224c1da0..0a4abccf61 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/states/dashboard-state-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/states/dashboard-state-dialog.component.ts @@ -111,7 +111,9 @@ export class DashboardStateDialogComponent extends return (c: UntypedFormControl) => { const newStateId: string = c.value.toLowerCase(); if (newStateId) { - const existing = this.states[newStateId]; + const existing = Object.keys(this.states).some( + key => key.toLowerCase() === newStateId + ); if (existing && newStateId !== this.prevStateId.toLowerCase()) { return { stateExists: true