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