mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Got rid of need for casting (#20088)
Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -46,12 +46,10 @@ export class RadioGroupLoadingComponentBuilder implements azdata.ComponentBuilde
|
||||
|
||||
let options: (string[] | azdata.CategoryValue[]) = optionsInfo.values!;
|
||||
let defaultValue: string | ResourceTypeOptionValue = optionsInfo.defaultValue!;
|
||||
if (optionsInfo.defaultValue) {
|
||||
if ((<ResourceTypeOptionValue>optionsInfo.defaultValue).displayName) {
|
||||
defaultValue = (<ResourceTypeOptionValue>optionsInfo.defaultValue).displayName;
|
||||
} else {
|
||||
defaultValue = optionsInfo.defaultValue;
|
||||
}
|
||||
if (typeof optionsInfo.defaultValue === 'string') {
|
||||
defaultValue = optionsInfo.defaultValue;
|
||||
} else {
|
||||
defaultValue = optionsInfo.defaultValue.displayName;
|
||||
}
|
||||
options.forEach((op: string | azdata.CategoryValue) => {
|
||||
const option: azdata.CategoryValue = (typeof op === 'string')
|
||||
|
||||
Reference in New Issue
Block a user