move request collection to ctor

This commit is contained in:
JesmoDev
2024-05-07 10:44:48 +02:00
parent 43e0988801
commit c2f5274b9e

View File

@@ -32,15 +32,11 @@ export class UmbCollectionDefaultElement extends UmbLitElement {
super();
this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => {
this.#collectionContext = context;
this.#collectionContext?.requestCollection();
this.#observeCollectionRoutes();
});
}
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
super.firstUpdated(_changedProperties);
this.#collectionContext?.requestCollection();
}
#observeCollectionRoutes() {
if (!this.#collectionContext) return;