提交 bd98ef51 编写于 作者: B Benjamin Smith

Add option to hide/show release notes on update #44020

上级 75d03a71
......@@ -27,6 +27,11 @@ configurationRegistry.registerConfiguration({
'type': 'boolean',
'default': product.quality === 'insider',
'description': nls.localize('enableWindowsBackgroundUpdates', "Enables Windows background updates.")
},
'update.showReleaseNotes': {
'type': 'boolean',
'default': true,
'description': nls.localize('showReleaseNotes', "Show Release Notes on update")
}
}
});
......@@ -32,6 +32,7 @@ import * as semver from 'semver';
import { OS } from 'vs/base/common/platform';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const NotNowAction = new Action(
'update.later',
......@@ -176,12 +177,14 @@ export class ProductContribution implements IWorkbenchContribution {
@IInstantiationService instantiationService: IInstantiationService,
@INotificationService notificationService: INotificationService,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@IEnvironmentService environmentService: IEnvironmentService
@IEnvironmentService environmentService: IEnvironmentService,
@IConfigurationService configurationService: IConfigurationService
) {
const lastVersion = storageService.get(ProductContribution.KEY, StorageScope.GLOBAL, '');
const showReleaseNotes = configurationService.getValue<boolean>('update.showReleaseNotes');
// was there an update? if so, open release notes
if (!environmentService.skipReleaseNotes && product.releaseNotesUrl && lastVersion && pkg.version !== lastVersion) {
if (showReleaseNotes && !environmentService.skipReleaseNotes && product.releaseNotesUrl && lastVersion && pkg.version !== lastVersion) {
instantiationService.invokeFunction(loadReleaseNotes, pkg.version).then(
text => editorService.openEditor(instantiationService.createInstance(ReleaseNotesInput, pkg.version, text), { pinned: true }),
() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册