Skip to content

Commit 1249686

Browse files
mustard-mhjeanp413
authored andcommitted
Disable download action
1 parent 4e16780 commit 1249686

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/vs/workbench/contrib/update/browser/update.contribution.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import { isWindows } from 'vs/base/common/platform';
1818
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
1919
import { mnemonicButtonLabel } from 'vs/base/common/labels';
2020
import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/common/update';
21-
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
2221
import { IOpenerService } from 'vs/platform/opener/common/opener';
2322
import { IProductService } from 'vs/platform/product/common/productService';
2423
import { URI } from 'vs/base/common/uri';
24+
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
2525

2626
const workbench = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
2727

@@ -140,6 +140,8 @@ class RestartToUpdateAction extends Action2 {
140140
}
141141
}
142142

143+
const CONTEXT_DONT_SHOW_DOWNLOAD_ACTION = new RawContextKey<false>('doNotShowDownloadAction', false);
144+
143145
class DownloadAction extends Action2 {
144146

145147
static readonly ID = 'workbench.action.download';
@@ -152,11 +154,11 @@ class DownloadAction extends Action2 {
152154
value: localize('openDownloadPage', "Download {0}", product.nameLong),
153155
original: `Download ${product.downloadUrl}`
154156
},
155-
precondition: IsWebContext, // Only show when running in a web browser
157+
precondition: CONTEXT_DONT_SHOW_DOWNLOAD_ACTION, // Only show when running in a web browser
156158
f1: true,
157159
menu: [{
158160
id: MenuId.StatusBarWindowIndicatorMenu,
159-
when: IsWebContext
161+
when: CONTEXT_DONT_SHOW_DOWNLOAD_ACTION
160162
}]
161163
});
162164
}

0 commit comments

Comments
 (0)