Fix handling of promises for title and description of pages in Quay
We were not correctly waiting for the `scope` on page to be filled before trying to calculate the title, and the logic for description was broken as well.
This commit is contained in:
parent
32022c9421
commit
091b937ee3
2 changed files with 23 additions and 17 deletions
|
@ -103,9 +103,10 @@ export function provideRun($rootScope: QuayRunScope,
|
|||
|
||||
// Listen for route changes and update the title and description accordingly.
|
||||
$rootScope.$on('$routeChangeSuccess', async(event, current, previous) => {
|
||||
$rootScope.title = metaService.getTitle(current) || defaultTitle;
|
||||
|
||||
const title = await metaService.getTitle(current);
|
||||
const description = await metaService.getDescription(current);
|
||||
|
||||
$rootScope.title = title || defaultTitle;
|
||||
if ($rootScope.description != description) {
|
||||
$rootScope.description = description;
|
||||
}
|
||||
|
|
Reference in a new issue