This commit is contained in:
Bill 2021-12-17 23:21:12 -05:00
parent f53c8199c2
commit a1ae6a384f
2 changed files with 10 additions and 6 deletions

View File

@ -21,7 +21,7 @@ export class ConfigurationManager extends NitroManager implements IConfiguration
protected onInit(): void protected onInit(): void
{ {
this.parseConfiguration(this.getDefaultConfig()); this.parseConfiguration(this.getDefaultConfig(), true);
this._pendingUrls = this.getValue<string[]>('config.urls').slice(); this._pendingUrls = this.getValue<string[]>('config.urls').slice();
@ -83,7 +83,7 @@ export class ConfigurationManager extends NitroManager implements IConfiguration
this.events && this.events.dispatchEvent(new ConfigurationEvent(type)); this.events && this.events.dispatchEvent(new ConfigurationEvent(type));
} }
private parseConfiguration(data: { [index: string]: any }): boolean private parseConfiguration(data: { [index: string]: any }, overrides: boolean = false): boolean
{ {
if(!data) return false; if(!data) return false;
@ -93,13 +93,18 @@ export class ConfigurationManager extends NitroManager implements IConfiguration
for(const key in data) for(const key in data)
{ {
if(this._definitions.has(key)) continue;
let value = data[key]; let value = data[key];
if(typeof value === 'string') value = this.interpolate((value as string), regex); if(typeof value === 'string') value = this.interpolate((value as string), regex);
this.setValue(key, value); if(this._definitions.has(key))
{
if(overrides) this.setValue(key, value);
}
else
{
this.setValue(key, value);
}
} }
return true; return true;

View File

@ -160,7 +160,6 @@ export class BadgeImageManager implements IDisposable
url = (Nitro.instance.getConfiguration<string>('badge.asset.url')).replace('%badgename%', badge); url = (Nitro.instance.getConfiguration<string>('badge.asset.url')).replace('%badgename%', badge);
break; break;
case BadgeImageManager.GROUP_BADGE: case BadgeImageManager.GROUP_BADGE:
//url = (Nitro.instance.getConfiguration<string>('badge.asset.group.url')).replace('%badgedata%', badge);
url = badge; url = badge;
break; break;
} }