From 4937976296b87af9aa75e089104c10da00b0bb4c Mon Sep 17 00:00:00 2001 From: mpetrov Date: Fri, 8 Nov 2024 12:12:42 +0200 Subject: [PATCH] refactoring --- .../dashboard-page/states/dashboard-state-dialog.component.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 0a4abccf61..c9224c1da0 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,9 +111,7 @@ export class DashboardStateDialogComponent extends return (c: UntypedFormControl) => { const newStateId: string = c.value.toLowerCase(); if (newStateId) { - const existing = Object.keys(this.states).some( - key => key.toLowerCase() === newStateId - ); + const existing = this.states[newStateId]; if (existing && newStateId !== this.prevStateId.toLowerCase()) { return { stateExists: true