Skip to content

Commit

Permalink
Fixes issue with config change detection
Browse files Browse the repository at this point in the history
References #225
  • Loading branch information
PKief committed Mar 19, 2018
1 parent 13680e9 commit 50e40e8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/helpers/change-detection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export const detectConfigChanges = () => {
const configs = Object.keys(getExtensionConfiguration())
.map(c => c.split('.').slice(1).join('.'));

return compareConfigs(configs).then(changes => {
return compareConfigs(configs).then(updatedOptions => {
// if there's nothing to update
if (!changes) return;
if (!updatedOptions) return;

// update icon json file with new options
return createIconFile(changes).then(() => {
return createIconFile(updatedOptions).then(() => {
promptToReload();
}).catch(err => {
console.error(err);
Expand All @@ -32,6 +32,9 @@ const compareConfigs = (configs: string[]): Promise<{ [name: string]: any }> =>

return getMaterialIconsJSON().then(json => {
configs.forEach(configName => {
// no further actions (e.g. reload) required
if (/show(Welcome|Update)Message/g.test(configName)) return;

const configValue = getThemeConfig(configName).globalValue;
const currentState = getObjectPropertyValue(json.options, configName);

Expand Down

0 comments on commit 50e40e8

Please sign in to comment.