diff --git a/client/src/modules/contentmanager.js b/client/src/modules/contentmanager.js index 8d98fc87..1b4be9ef 100644 --- a/client/src/modules/contentmanager.js +++ b/client/src/modules/contentmanager.js @@ -256,16 +256,22 @@ export default class { /** * Unload content. * @param {Content|String} content Content to unload + * @param {Boolean} force If true the content will be unloaded even if an exception is thrown when disabling/unloading * @param {Boolean} reload Whether to reload the content after * @return {Content} */ - static async unloadContent(content, reload) { + static async unloadContent(content, force, reload) { content = this.findContent(content); if (!content) throw {message: `Could not find a ${this.contentType} from ${content}.`}; try { - await content.disable(false); - await content.emit('unload', reload); + const disablePromise = content.disable(false); + const unloadPromise = content.emit('unload', reload); + + if (!force) { + await disablePromise; + await unloadPromise; + } const index = this.getContentIndex(content); @@ -288,10 +294,11 @@ export default class { /** * Reload content. * @param {Content|String} content Content to reload + * @param {Boolean} force If true the content will be unloaded even if an exception is thrown when disabling/unloading * @return {Content} */ - static reloadContent(content) { - return this.unloadContent(content, true); + static reloadContent(content, force) { + return this.unloadContent(content, force, true); } /** diff --git a/client/src/modules/plugin.js b/client/src/modules/plugin.js index 039ba05e..5a6b36ef 100644 --- a/client/src/modules/plugin.js +++ b/client/src/modules/plugin.js @@ -18,12 +18,12 @@ export default class Plugin extends Content { get start() { return this.enable } get stop() { return this.disable } - reload() { - return PluginManager.reloadPlugin(this); + reload(force) { + return PluginManager.reloadPlugin(this, force); } - unload() { - return PluginManager.unloadPlugin(this); + unload(force) { + return PluginManager.unloadPlugin(this, force); } } diff --git a/client/src/modules/settings.js b/client/src/modules/settings.js index bd16f2f2..e9256b9d 100644 --- a/client/src/modules/settings.js +++ b/client/src/modules/settings.js @@ -94,7 +94,7 @@ export default new class Settings { } } catch (err) { // There was an error saving settings - Logger.err('Settings', err); + Logger.err('Settings', ['Failed to save internal settings', err]); throw err; } }