From 43f8678c7a094ac6f160d541b7c134a7e8e8d73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 6 Apr 2017 17:59:31 -0400 Subject: [PATCH] update local config immediately --- src/meta/configs.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/meta/configs.js b/src/meta/configs.js index 82d8640e4c..daaa807d19 100644 --- a/src/meta/configs.js +++ b/src/meta/configs.js @@ -101,16 +101,21 @@ module.exports = function (Meta) { } function updateConfig(config) { + updateLocalConfig(config); pubsub.publish('config:update', config); } + function updateLocalConfig(config) { + for (var field in config) { + if (config.hasOwnProperty(field)) { + Meta.config[field] = config[field]; + } + } + } + pubsub.on('config:update', function onConfigReceived(config) { if (typeof config === 'object' && Meta.config) { - for (var field in config) { - if (config.hasOwnProperty(field)) { - Meta.config[field] = config[field]; - } - } + updateLocalConfig(config); } });