mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 22:12:26 +01:00
debt - convert our dialog API use to async (for #39536)
This commit is contained in:
@@ -30,11 +30,9 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape {
|
||||
return Promise.reject(new Error('Not supported - Open-dialogs can only be opened on `file`-uris.'));
|
||||
}
|
||||
return new Promise<string[]>(resolve => {
|
||||
const filenames = this._windowService.showOpenDialog(
|
||||
this._windowService.showOpenDialog(
|
||||
MainThreadDialogs._convertOpenOptions(options)
|
||||
);
|
||||
|
||||
resolve(isFalsyOrEmpty(filenames) ? undefined : filenames);
|
||||
).then(filenames => resolve(isFalsyOrEmpty(filenames) ? undefined : filenames));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,10 +42,9 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape {
|
||||
return Promise.reject(new Error('Not supported - Save-dialogs can only be opened on `file`-uris.'));
|
||||
}
|
||||
return new Promise<string>(resolve => {
|
||||
const filename = this._windowService.showSaveDialog(
|
||||
this._windowService.showSaveDialog(
|
||||
MainThreadDialogs._convertSaveOptions(options)
|
||||
);
|
||||
resolve(!filename ? undefined : filename);
|
||||
).then(filename => resolve(!filename ? undefined : filename));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user