Skip to content

Commit

Permalink
Add option to hide/show release notes on update #44020
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Smith committed Feb 23, 2018
1 parent 75d03a7 commit bd98ef5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/vs/platform/update/node/update.config.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
});
7 changes: 5 additions & 2 deletions src/vs/workbench/parts/update/electron-browser/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 }),
() => {
Expand Down

0 comments on commit bd98ef5

Please sign in to comment.