From d3c2d35ecb8cb9e5e974f6c1919a6903cacc0cba Mon Sep 17 00:00:00 2001 From: Cristina Malin Date: Wed, 28 Feb 2024 16:11:42 +0100 Subject: [PATCH] Fixed: API not loaded the first time --- src/components/apis/details-of-api/ko/runtime/api-details.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/apis/details-of-api/ko/runtime/api-details.ts b/src/components/apis/details-of-api/ko/runtime/api-details.ts index e65297bd4..4a461e2ff 100644 --- a/src/components/apis/details-of-api/ko/runtime/api-details.ts +++ b/src/components/apis/details-of-api/ko/runtime/api-details.ts @@ -44,7 +44,8 @@ export class ApiDetails { @OnMounted() public async initialize(): Promise { const apiName = this.routeHelper.getApiName(); - + this.router.addRouteChangeListener(this.onRouteChange); + if (!apiName) { return; } @@ -52,7 +53,6 @@ export class ApiDetails { this.selectedApiName(apiName); await this.loadApi(apiName); - this.router.addRouteChangeListener(this.onRouteChange); this.currentApiVersion.subscribe(this.onVersionChange); this.downloadSelected.subscribe(this.onDownloadChange); }