diff --git a/client/src/modules/contentmanager.js b/client/src/modules/contentmanager.js index c35c4b89..cf2f8165 100644 --- a/client/src/modules/contentmanager.js +++ b/client/src/modules/contentmanager.js @@ -10,15 +10,16 @@ import Content from './content'; import Globals from './globals'; +import Database from './database'; import { Utils, FileUtils, ClientLogger as Logger } from 'common'; -import path from 'path'; import { Events } from 'modules'; import { SettingsSet, ErrorEvent } from 'structs'; import { Modals } from 'ui'; -import Database from './database'; +import path from 'path'; +import Combokeys from 'combokeys'; /** - * Base class for external content managing + * Base class for managing external content */ export default class { @@ -209,10 +210,12 @@ export default class { userConfig.config.setSaved(); for (let setting of userConfig.config.findSettings(() => true)) { + // This will load custom settings + // Setting the content's path on only the live config (and not the default config) ensures that custom settings will not be loaded on the default settings setting.setContentPath(contentPath); } - Utils.deepfreeze(defaultConfig); + Utils.deepfreeze(defaultConfig, object => object instanceof Combokeys); const configs = { defaultConfig, diff --git a/common/modules/utils.js b/common/modules/utils.js index d032b264..99aecfa2 100644 --- a/common/modules/utils.js +++ b/common/modules/utils.js @@ -146,12 +146,14 @@ export class Utils { return value; } - static deepfreeze(object) { + static deepfreeze(object, exclude) { + if (exclude && exclude(object)) return; + if (typeof object === 'object' && object !== null) { const properties = Object.getOwnPropertyNames(object); for (let property of properties) { - this.deepfreeze(object[property]); + this.deepfreeze(object[property], exclude); } Object.freeze(object);