Paths compatibility
This commit is contained in:
parent
9c1a93f4c1
commit
f3ea192974
|
@ -143,6 +143,7 @@ export class BetterDiscord {
|
|||
|
||||
BetterDiscord.loaded = true;
|
||||
this._args = args;
|
||||
this.config.compatibility();
|
||||
|
||||
this.bindings();
|
||||
this.parseClientPackage();
|
||||
|
|
|
@ -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 }));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue