Can’t freeze internals as then Vue can’t make any plugin/theme’s info and enabled state reactive
This commit is contained in:
parent
bc1f93dd89
commit
47c786a98a
|
@ -15,17 +15,10 @@ import Database from './database';
|
|||
export default class Content {
|
||||
|
||||
constructor(internals) {
|
||||
Object.freeze(internals);
|
||||
Utils.deepfreeze(internals.info);
|
||||
Object.freeze(internals.paths);
|
||||
Object.freeze(internals.configs);
|
||||
|
||||
Object.defineProperty(this, '__internals', {
|
||||
value: internals,
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: false
|
||||
});
|
||||
this.__internals = internals;
|
||||
|
||||
this.settings.on('setting-updated', event => this.events.emit('setting-updated', event));
|
||||
this.settings.on('settings-updated', event => this.events.emit('settings-updated', event));
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
// TODO Display error if plugin fails to start/stop
|
||||
try {
|
||||
await plugin.enabled ? PluginManager.stopPlugin(plugin) : PluginManager.startPlugin(plugin);
|
||||
this.$forceUpdate();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
@ -79,7 +78,6 @@
|
|||
async reloadPlugin(plugin) {
|
||||
try {
|
||||
await PluginManager.reloadPlugin(plugin);
|
||||
this.$forceUpdate();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
@ -88,7 +86,6 @@
|
|||
try {
|
||||
if (unload) await PluginManager.unloadPlugin(plugin);
|
||||
else await PluginManager.deletePlugin(plugin);
|
||||
this.$forceUpdate();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
// TODO Display error if theme fails to enable/disable
|
||||
try {
|
||||
await theme.enabled ? ThemeManager.disableTheme(theme) : ThemeManager.enableTheme(theme);
|
||||
this.$forceUpdate();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
@ -80,7 +79,6 @@
|
|||
try {
|
||||
if (reload) await ThemeManager.reloadTheme(theme);
|
||||
else await theme.recompile();
|
||||
this.$forceUpdate();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
@ -89,7 +87,6 @@
|
|||
try {
|
||||
if (unload) await ThemeManager.unloadTheme(theme);
|
||||
else await ThemeManager.deleteTheme(theme);
|
||||
this.$forceUpdate();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue