diff --git a/frontend/src/static/js/components/webstatus-feature-page.ts b/frontend/src/static/js/components/webstatus-feature-page.ts index a6301447..9193d68d 100644 --- a/frontend/src/static/js/components/webstatus-feature-page.ts +++ b/frontend/src/static/js/components/webstatus-feature-page.ts @@ -30,13 +30,17 @@ export class FeaturePage extends LitElement { @state() feature?: components['schemas']['Feature'] | undefined - id!: string - + featureId!: string @state() loading: boolean = true + location!: { params: { featureId: string } } // Set by router. + async firstUpdated(): Promise { - this.feature = await this.apiClient.getFeature(this.id) + // TODO(jrobbins): Use routerContext instead of this.location so that + // nested components could also access the router. + this.featureId = this.location.params.featureId + this.feature = await this.apiClient.getFeature(this.featureId) this.loading = false } @@ -45,7 +49,7 @@ export class FeaturePage extends LitElement { return html`Loading` } else { return html` -

Feature Page

+

${this.feature?.name}

spec size: ${this.feature?.spec != null ? this.feature.spec.length : 0}
Specs: