Settings should only watch for uwSettings storage changes, Logger should only monitor for uwLogger changes
This commit is contained in:
parent
9ba1afebee
commit
1899f486e1
@ -16,7 +16,11 @@ class Logger {
|
||||
static syncConfig(callback) {
|
||||
const br = currentBrowser.firefox ? browser : chrome;
|
||||
br.storage.onChanged.addListener( (changes, area) => {
|
||||
callback(JSON.parse(changes.uwLogger.newValue));
|
||||
if (changes.uwLogger) {
|
||||
const newLoggerConf = JSON.parse(changes.uwLogger.newValue)
|
||||
console.info('Logger settings reloaded. New conf:', conf);
|
||||
callback(newLoggerConf);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,9 @@ class Settings {
|
||||
}
|
||||
|
||||
storageChangeListener(changes, area) {
|
||||
if (!changes.uwSettings) {
|
||||
return;
|
||||
}
|
||||
this.logger.log('info', 'settings', "[Settings::<storage/on change>] Settings have been changed outside of here. Updating active settings. Changes:", changes, "storage area:", area);
|
||||
if (changes['uwSettings'] && changes['uwSettings'].newValue) {
|
||||
this.logger.log('info', 'settings',"[Settings::<storage/on change>] new settings object:", JSON.parse(changes.uwSettings.newValue));
|
||||
|
Loading…
Reference in New Issue
Block a user