simpler use

This commit is contained in:
Niels Lyngsø
2023-01-04 10:06:51 +01:00
parent 766f2e08f8
commit 54229babf4
2 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ export class UmbExtensionRootWorkspaceElement extends UmbLitElement {
}
private _observeExtensions() {
this.observe<Array<ManifestTypes>>(umbExtensionsRegistry.extensions, (extensions) => {
this.observe(umbExtensionsRegistry.extensions, (extensions) => {
this._extensions = extensions || undefined;
});
}

View File

@@ -56,12 +56,12 @@ export class UmbCollectionSelectionActionsElement extends UmbLitElement {
if (!this._collectionContext) return;
// TODO: Make sure it only updates on length change.
this.observe<Array<MediaDetails>>(this._collectionContext.data, (mediaItems) => {
this._nodesLength = mediaItems?.length || 0;
this.observe(this._collectionContext.data, (mediaItems) => {
this._nodesLength = mediaItems.length;
});
this.observe<Array<string>>(this._collectionContext.selection, (selection) => {
this._selectionLength = selection?.length || 0;
this.observe(this._collectionContext.selection, (selection) => {
this._selectionLength = selection.length;
});
}