diff --git a/core/src/main.js b/core/src/main.js index d7581000..914abede 100644 --- a/core/src/main.js +++ b/core/src/main.js @@ -143,6 +143,7 @@ export class BetterDiscord { BetterDiscord.loaded = true; this._args = args; + this.config.compatibility(); this.bindings(); this.parseClientPackage(); diff --git a/core/src/modules/config.js b/core/src/modules/config.js index 2eb1c2dc..2de5839d 100644 --- a/core/src/modules/config.js +++ b/core/src/modules/config.js @@ -29,13 +29,12 @@ export default class Config extends Module { } getPath(id, full) { - return this.paths[id]; - // const path = this.paths.find(path => path.id === id); - // return full ? path : path.path; + const path = this.paths.find(p => p.id === id); + return full ? path : path.path; } addPath(id, path) { - this.paths[id] = path; + this.paths.push({ id, path }); } get config() { @@ -45,4 +44,8 @@ export default class Config extends Module { }; } + // Compatibility with old client code and new installer args + compatibility() { + this.args.paths = Object.entries(this.args.paths).map(([id, path]) => ({ id, path })); + } }