Fix creation of terminal profiles via dropdown

Fixes #131577
This commit is contained in:
Daniel Imms
2021-08-25 14:28:43 -07:00
parent e96fcce300
commit 08069da007

View File

@@ -2004,12 +2004,8 @@ export function validateTerminalName(name: string): { content: string, severity:
}
function convertOptionsOrProfileToOptions(optionsOrProfile?: ICreateTerminalOptions | ITerminalProfile): ICreateTerminalOptions | undefined {
if (typeof optionsOrProfile === 'object') {
if ('profileName' in optionsOrProfile) {
return { config: optionsOrProfile as ITerminalProfile, location: (optionsOrProfile as ICreateTerminalOptions).location };
} else if ('location' in optionsOrProfile) {
return { location: (optionsOrProfile as ICreateTerminalOptions).location };
}
if (typeof optionsOrProfile === 'object' && 'profileName' in optionsOrProfile) {
return { config: optionsOrProfile as ITerminalProfile, location: (optionsOrProfile as ICreateTerminalOptions).location };
}
return optionsOrProfile;
}