Add afterSettingsSaved callback

This commit is contained in:
Tamius Han 2020-12-21 23:27:45 +01:00
parent 4b5c5a8dce
commit c0c454f3ef

View File

@ -18,6 +18,7 @@ class Settings {
// Options: activeSettings, updateCallback, logger
this.logger = options.logger;
this.onSettingsChanged = options.onSettingsChanged;
this.afterSettingsSaved = options.afterSettingsSaved;
this.active = options.activeSettings ?? undefined;
this.default = ExtensionConf;
this.default['version'] = this.getExtensionVersion();
@ -48,14 +49,14 @@ class Settings {
try {
this.onSettingsChanged();
this.logger.log('info', 'settings', '[Settings] Update callback finished.')
} catch (e) {
this.logger.log('error', 'settings', "[Settings] CALLING UPDATE CALLBACK FAILED. Reason:", e)
}
}
if (this.afterSettingsSaved) {
this.afterSettingsSaved();
}
}
static getExtensionVersion() {