Add afterSettingsSaved callback
This commit is contained in:
parent
4b5c5a8dce
commit
c0c454f3ef
@ -18,6 +18,7 @@ class Settings {
|
|||||||
// Options: activeSettings, updateCallback, logger
|
// Options: activeSettings, updateCallback, logger
|
||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
this.onSettingsChanged = options.onSettingsChanged;
|
this.onSettingsChanged = options.onSettingsChanged;
|
||||||
|
this.afterSettingsSaved = options.afterSettingsSaved;
|
||||||
this.active = options.activeSettings ?? undefined;
|
this.active = options.activeSettings ?? undefined;
|
||||||
this.default = ExtensionConf;
|
this.default = ExtensionConf;
|
||||||
this.default['version'] = this.getExtensionVersion();
|
this.default['version'] = this.getExtensionVersion();
|
||||||
@ -48,14 +49,14 @@ class Settings {
|
|||||||
try {
|
try {
|
||||||
this.onSettingsChanged();
|
this.onSettingsChanged();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.logger.log('info', 'settings', '[Settings] Update callback finished.')
|
this.logger.log('info', 'settings', '[Settings] Update callback finished.')
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.log('error', 'settings', "[Settings] CALLING UPDATE CALLBACK FAILED. Reason:", e)
|
this.logger.log('error', 'settings', "[Settings] CALLING UPDATE CALLBACK FAILED. Reason:", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.afterSettingsSaved) {
|
||||||
|
this.afterSettingsSaved();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static getExtensionVersion() {
|
static getExtensionVersion() {
|
||||||
|
Loading…
Reference in New Issue
Block a user