@@ -188,21 +188,30 @@ export class WebAppComponent implements OnInit, OnDestroy {
|
||||
)
|
||||
.subscribe((event) => {
|
||||
if (!event['title']) {
|
||||
this.i18nService.translate('APP_NAME').pipe(take(1)).subscribe((t: any) => this.titleService.setTitle(t));
|
||||
this.i18nService
|
||||
.translate('APP_NAME')
|
||||
.pipe(take(1))
|
||||
.subscribe((t: any) => this.titleService.setTitle(t));
|
||||
return;
|
||||
}
|
||||
const raw = event['title'];
|
||||
const textKey = `labels.text.${raw}`;
|
||||
const menuKey = `labels.menus.${raw}`;
|
||||
this.i18nService.translate(textKey).pipe(take(1)).subscribe((textResult: any) => {
|
||||
if (textResult !== textKey) {
|
||||
this.titleService.setTitle(textResult);
|
||||
} else {
|
||||
this.i18nService.translate(menuKey).pipe(take(1)).subscribe((menuResult: any) => {
|
||||
this.titleService.setTitle(menuResult !== menuKey ? menuResult : raw);
|
||||
});
|
||||
}
|
||||
});
|
||||
this.i18nService
|
||||
.translate(textKey)
|
||||
.pipe(take(1))
|
||||
.subscribe((textResult: any) => {
|
||||
if (textResult !== textKey) {
|
||||
this.titleService.setTitle(textResult);
|
||||
} else {
|
||||
this.i18nService
|
||||
.translate(menuKey)
|
||||
.pipe(take(1))
|
||||
.subscribe((menuResult: any) => {
|
||||
this.titleService.setTitle(menuResult !== menuKey ? menuResult : raw);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Stores top 100 user activites as local storage object.
|
||||
|
||||
Reference in New Issue
Block a user