Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/vs
diff options
context:
space:
mode:
authorSandeep Somavarapu <sasomava@microsoft.com>2022-07-28 07:23:17 +0300
committerGitHub <noreply@github.com>2022-07-28 07:23:17 +0300
commit916f7677fceedc80bfa3dbc037daddb78e949b01 (patch)
treedcf361e2a368b286b7a5cdfefff9ad6a90d34cc5 /src/vs
parent3e26d50f995f4ed76adedff0138138b29b958625 (diff)
Fix #156321 (#156524)
Diffstat (limited to 'src/vs')
-rw-r--r--src/vs/workbench/contrib/userDataProfile/common/userDataProfileActions.ts19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/vs/workbench/contrib/userDataProfile/common/userDataProfileActions.ts b/src/vs/workbench/contrib/userDataProfile/common/userDataProfileActions.ts
index f1d27222b50..62e3de604fe 100644
--- a/src/vs/workbench/contrib/userDataProfile/common/userDataProfileActions.ts
+++ b/src/vs/workbench/contrib/userDataProfile/common/userDataProfileActions.ts
@@ -375,6 +375,7 @@ registerAction2(class ImportProfileAction extends Action2 {
const userDataProfileImportExportService = accessor.get(IUserDataProfileImportExportService);
const dialogService = accessor.get(IDialogService);
const contextKeyService = accessor.get(IContextKeyService);
+ const notificationService = accessor.get(INotificationService);
const isSettingProfilesEnabled = contextKeyService.contextMatchesRules(PROFILES_ENABLEMENT_CONTEXT);
@@ -401,14 +402,18 @@ registerAction2(class ImportProfileAction extends Action2 {
quickPick.matchOnLabel = false;
quickPick.matchOnDescription = false;
disposables.add(quickPick.onDidAccept(async () => {
- quickPick.hide();
- const profile = quickPick.selectedItems[0].description ? await this.getProfileFromURL(quickPick.value, requestService) : await this.getProfileFromFileSystem(fileDialogService, fileService);
- if (profile) {
- if (isSettingProfilesEnabled) {
- await userDataProfileImportExportService.importProfile(profile);
- } else {
- await userDataProfileImportExportService.setProfile(profile);
+ try {
+ quickPick.hide();
+ const profile = quickPick.selectedItems[0].description ? await this.getProfileFromURL(quickPick.value, requestService) : await this.getProfileFromFileSystem(fileDialogService, fileService);
+ if (profile) {
+ if (isSettingProfilesEnabled) {
+ await userDataProfileImportExportService.importProfile(profile);
+ } else {
+ await userDataProfileImportExportService.setProfile(profile);
+ }
}
+ } catch (error) {
+ notificationService.error(error);
}
}));
disposables.add(quickPick.onDidHide(() => disposables.dispose()));