mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
debt - remove TPromise.any and use Promise.race instead
This commit is contained in:
@@ -53,8 +53,11 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
||||
canPickMany: options && options.canPickMany
|
||||
}, token);
|
||||
|
||||
return TPromise.any(<TPromise<number | Item[]>[]>[quickPickWidget, itemsPromise]).then(values => {
|
||||
if (values.key === '0') {
|
||||
const widgetClosedMarker = {};
|
||||
const widgetClosedPromise = quickPickWidget.then(() => widgetClosedMarker);
|
||||
|
||||
return Promise.race([widgetClosedPromise, itemsPromise]).then(result => {
|
||||
if (result === widgetClosedMarker) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user