fix(core): update

This commit is contained in:
Philipp Kunz 2020-11-05 18:36:08 +00:00
parent 3d6a421d25
commit fda71ac3e6
2 changed files with 11 additions and 9 deletions

View File

@ -31,26 +31,27 @@ export class TagManager {
this.baseLevel.addCompanyInfo(metaObjectArg.ldCompany);
}
await this.globalLevel.enable();
await this.baseLevel.enable();
this.activeLevel = this.baseLevel;
await this.activeLevel.enable();
}
public setSubPageLevel(metaObjectArg: interfaces.IMetaObject) {
public async setSubPageLevel(metaObjectArg: interfaces.IMetaObject) {
const subPageLevel = new TagLevel(this, 'subpage');
subPageLevel.title = metaObjectArg.title;
if (metaObjectArg.description) {
this.baseLevel.addTag(new MetaTag('description', metaObjectArg.description));
}
this.activeLevel.disable();
await this.activeLevel.disable();
this.activeLevel = subPageLevel;
this.activeLevel.enable();
await this.activeLevel.enable();
return subPageLevel;
}
public revertToBaseLevel() {
public async revertToBaseLevel() {
if (this.activeLevel !== this.baseLevel) {
this.activeLevel.disable();
await this.activeLevel.disable();
this.activeLevel = this.baseLevel;
this.activeLevel.enable();
await this.activeLevel.enable();
}
}
}

View File

@ -43,7 +43,8 @@ export class WebSetup {
* sets a subpage
* @param metaObjectArg
*/
public setSubLevel(metaObjectArg: interfaces.IMetaObject) {
return this.tagManager.setSubPageLevel(metaObjectArg);
public async setSubLevel(metaObjectArg: interfaces.IMetaObject) {
const subLevel = await this.tagManager.setSubPageLevel(metaObjectArg);
return subLevel;
}
}