Browse Source

fix(lib): type safety in symbol autocomplete

pull/6498/head
KenTandrian 3 weeks ago
parent
commit
0af41fea76
  1. 2
      libs/common/src/lib/interfaces/lookup-item.interface.ts
  2. 4
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

2
libs/common/src/lib/interfaces/lookup-item.interface.ts

@ -7,7 +7,7 @@ export interface LookupItem {
assetSubClass: AssetSubClass;
currency: string;
dataProviderInfo: DataProviderInfo;
dataSource: DataSource;
dataSource: DataSource | null;
name: string;
symbol: string;
}

4
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.ts

@ -185,7 +185,7 @@ export class GfSymbolAutocompleteComponent
public ngDoCheck() {
if (this.ngControl) {
this.validateRequired();
this.errorState = this.ngControl.invalid && this.ngControl.touched;
this.errorState = !!(this.ngControl.invalid && this.ngControl.touched);
this.stateChanges.next();
}
}
@ -225,7 +225,7 @@ export class GfSymbolAutocompleteComponent
? !super.value?.dataSource || !super.value?.symbol
: false;
if (requiredCheck) {
this.ngControl.control.setErrors({ invalidData: true });
this.ngControl.control?.setErrors({ invalidData: true });
}
}
}

Loading…
Cancel
Save