chore: Automatically reloads window after an accent change.

This commit is contained in:
octod 2017-07-24 11:05:15 +02:00
parent 16029bade8
commit 752912d49d
2 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ import {IAccentCustomProperty} from '../../interfaces/iaccent-custom-property';
import { IDefaults } from "../../interfaces/idefaults"; import { IDefaults } from "../../interfaces/idefaults";
import {IGenericObject} from '../../interfaces/igeneric-object'; import {IGenericObject} from '../../interfaces/igeneric-object';
import { updateAccent, isMaterialTheme, isMaterialThemeIcons } from "../../helpers/settings"; import { updateAccent, isMaterialTheme, isMaterialThemeIcons } from "../../helpers/settings";
import { getCurrentThemeID, getCurrentThemeIconsID, askForWindowReload } from "../../helpers/vscode"; import { getCurrentThemeID, getCurrentThemeIconsID, reloadWindow } from "../../helpers/vscode";
import { THEME_ICONS } from "../theme-icons/index"; import { THEME_ICONS } from "../theme-icons/index";
const REGEXP_HEX: RegExp = /^#([0-9A-F]{6}|[0-9A-F]{8})$/i; const REGEXP_HEX: RegExp = /^#([0-9A-F]{6}|[0-9A-F]{8})$/i;
@ -98,7 +98,7 @@ function setWorkbenchOptions(accentSelected: string | undefined, config: any): v
updateAccent(accentSelected); updateAccent(accentSelected);
if (isMaterialTheme(themeID) && isMaterialThemeIcons(themeIconsID)) { if (isMaterialTheme(themeID) && isMaterialThemeIcons(themeIconsID)) {
THEME_ICONS().then(() => askForWindowReload()); THEME_ICONS().then(() => reloadWindow());
} }
}, reason => { }, reason => {
vscode.window.showErrorMessage(reason); vscode.window.showErrorMessage(reason);

View file

@ -48,7 +48,7 @@ export const THEME_ICONS = () => {
deferred.resolve(); deferred.resolve();
}); });
} else { } else {
deferred.reject(); deferred.resolve();
} }
return promise; return promise;