From d5da7166def7507fac38521a972f717fc3cc3710 Mon Sep 17 00:00:00 2001 From: sogehige Date: Thu, 27 Feb 2020 19:14:54 +0100 Subject: [PATCH] fix(watchers): save core variables with type (#3304) --- src/bot/watchers.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bot/watchers.ts b/src/bot/watchers.ts index d91bf0456e2..a55c8f6a40b 100644 --- a/src/bot/watchers.ts +++ b/src/bot/watchers.ts @@ -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 {