refactoring

This commit is contained in:
mpetrov 2024-11-08 12:12:42 +02:00
parent dc7f011059
commit 4937976296

View File

@ -111,9 +111,7 @@ export class DashboardStateDialogComponent extends
return (c: UntypedFormControl) => { return (c: UntypedFormControl) => {
const newStateId: string = c.value.toLowerCase(); const newStateId: string = c.value.toLowerCase();
if (newStateId) { if (newStateId) {
const existing = Object.keys(this.states).some( const existing = this.states[newStateId];
key => key.toLowerCase() === newStateId
);
if (existing && newStateId !== this.prevStateId.toLowerCase()) { if (existing && newStateId !== this.prevStateId.toLowerCase()) {
return { return {
stateExists: true stateExists: true