Skip to content

Commit a3640cf

Browse files
author
Alberto Iannaccone
authored
use electron reload command when changing language (#953)
1 parent 03a7527 commit a3640cf

File tree

1 file changed

+6
-2
lines changed
  • arduino-ide-extension/src/browser/dialogs/settings

1 file changed

+6
-2
lines changed

arduino-ide-extension/src/browser/dialogs/settings/settings.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import {
1515
FileSystemExt,
1616
Network,
1717
} from '../../../common/protocol';
18-
import { nls } from '@theia/core/lib/common';
18+
import { CommandService, nls } from '@theia/core/lib/common';
1919
import { AsyncLocalizationProvider } from '@theia/core/lib/common/i18n/localization';
20+
import { ElectronCommands } from '@theia/core/lib/electron-browser/menu/electron-menu-contribution';
2021

2122
export const EDITOR_SETTING = 'editor';
2223
export const FONT_SIZE_SETTING = `${EDITOR_SETTING}.fontSize`;
@@ -82,6 +83,9 @@ export class SettingsService {
8283
@inject(AsyncLocalizationProvider)
8384
protected readonly localizationProvider: AsyncLocalizationProvider;
8485

86+
@inject(CommandService)
87+
protected commandService: CommandService;
88+
8589
protected readonly onDidChangeEmitter = new Emitter<Readonly<Settings>>();
8690
readonly onDidChange = this.onDidChangeEmitter.event;
8791
protected readonly onDidResetEmitter = new Emitter<Readonly<Settings>>();
@@ -282,7 +286,7 @@ export class SettingsService {
282286
} else {
283287
window.localStorage.setItem(nls.localeId, currentLanguage);
284288
}
285-
window.location.reload();
289+
this.commandService.executeCommand(ElectronCommands.RELOAD.id);
286290
}
287291

288292
return true;

0 commit comments

Comments
 (0)