mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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 options: (string[] | azdata.CategoryValue[]) = optionsInfo.values!;
|
||||||
let defaultValue: string | ResourceTypeOptionValue = optionsInfo.defaultValue!;
|
let defaultValue: string | ResourceTypeOptionValue = optionsInfo.defaultValue!;
|
||||||
if (optionsInfo.defaultValue) {
|
if (typeof optionsInfo.defaultValue === 'string') {
|
||||||
if ((<ResourceTypeOptionValue>optionsInfo.defaultValue).displayName) {
|
defaultValue = optionsInfo.defaultValue;
|
||||||
defaultValue = (<ResourceTypeOptionValue>optionsInfo.defaultValue).displayName;
|
} else {
|
||||||
} else {
|
defaultValue = optionsInfo.defaultValue.displayName;
|
||||||
defaultValue = optionsInfo.defaultValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
options.forEach((op: string | azdata.CategoryValue) => {
|
options.forEach((op: string | azdata.CategoryValue) => {
|
||||||
const option: azdata.CategoryValue = (typeof op === 'string')
|
const option: azdata.CategoryValue = (typeof op === 'string')
|
||||||
|
|||||||
Reference in New Issue
Block a user