Skip to content

Commit

Permalink
Check for updates in offline mode from context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jul 24, 2018
1 parent 7fef11f commit 35d20ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/platform/actions/common/offlineMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class NotifyUnsupportedFeatureInOfflineMode extends Action {
@IConfigurationService private configurationService: IConfigurationService,
@INotificationService private notificationService: INotificationService
) {
super(id);
super(id, label);
}

run(): TPromise<any> {
Expand Down
14 changes: 12 additions & 2 deletions src/vs/workbench/parts/update/electron-browser/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows';
import { ReleaseNotesManager } from './releaseNotesEditor';
import { isWindows } from 'vs/base/common/platform';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { offlineModeSetting } from 'vs/platform/actions/common/offlineMode';
import { offlineModeSetting, NotifyUnsupportedFeatureInOfflineMode } from 'vs/platform/actions/common/offlineMode';

let releaseNotesManager: ReleaseNotesManager | undefined = undefined;

Expand Down Expand Up @@ -322,7 +322,8 @@ export class UpdateContribution implements IGlobalActivity {
@IDialogService private dialogService: IDialogService,
@IUpdateService private updateService: IUpdateService,
@IActivityService private activityService: IActivityService,
@IWindowService private windowService: IWindowService
@IWindowService private windowService: IWindowService,
@IConfigurationService private configurationService: IConfigurationService
) {
this.state = updateService.state;

Expand Down Expand Up @@ -546,6 +547,15 @@ export class UpdateContribution implements IGlobalActivity {
}

private getUpdateAction(): IAction | null {
if (this.configurationService.getValue(offlineModeSetting) === true) {
return new NotifyUnsupportedFeatureInOfflineMode(
NotifyUnsupportedFeatureInOfflineMode.ID,
nls.localize('checkForUpdates', "Check for Updates..."),
this.configurationService,
this.notificationService
);
}

const state = this.updateService.state;

switch (state.type) {
Expand Down

0 comments on commit 35d20ed

Please sign in to comment.