Skip to content

Commit

Permalink
fix(watchers): save core variables with type (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Feb 27, 2020
1 parent 9d73f63 commit d5da716
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bot/watchers.ts
Expand Up @@ -67,9 +67,8 @@ export const VariableWatcher = {
value: JSON.stringify(value),
});

const path = type === 'core' ? `${name}.${variable}` : `${type}.${name}.${variable}`;
change(path);
for (const event of getFunctionList('change', path)) {
change(`${type}.${name}.${variable}`);
for (const event of getFunctionList('change', type === 'core' ? `${name}.${variable}` : `${type}.${name}.${variable}`)) {
if (typeof self[event.fName] === 'function') {
self[event.fName](variable, cloneDeep(value));
} else {
Expand Down

0 comments on commit d5da716

Please sign in to comment.