web/user: fix search not updating app (#7825)

web/user: fix app not updating

so when using two classes in a classMap directive, the update fails (basically saying that each class must be separated), however this error only shows when directly calling requestUpdate and is swallowed somewhere when relying on the default render cycle

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-12-08 16:03:45 +02:00 committed by GitHub
parent 23d3d6ddc4
commit fef1090a4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -96,7 +96,7 @@ export class LibraryApplication extends AKElement {
this.application.metaPublisher !== "" || this.application.metaPublisher !== "" ||
this.application.metaDescription !== ""; this.application.metaDescription !== "";
const classes = { "pf-m-selectable pf-m-selected": this.selected }; const classes = { "pf-m-selectable": this.selected, "pf-m-selected": this.selected };
const styles = this.background ? { background: this.background } : {}; const styles = this.background ? { background: this.background } : {};
return html` <div return html` <div

View File

@ -38,7 +38,9 @@ export class LibraryPageApplicationList extends AKElement {
]; ];
@property({ attribute: false }) @property({ attribute: false })
apps: Application[] = []; set apps(value: Application[]) {
this.fuse.setCollection(value);
}
@property() @property()
query = getURLParam<string | undefined>("search", undefined); query = getURLParam<string | undefined>("search", undefined);
@ -63,7 +65,7 @@ export class LibraryPageApplicationList extends AKElement {
shouldSort: true, shouldSort: true,
ignoreFieldNorm: true, ignoreFieldNorm: true,
useExtendedSearch: true, useExtendedSearch: true,
threshold: 0.5, threshold: 0.3,
}); });
} }
@ -77,7 +79,6 @@ export class LibraryPageApplicationList extends AKElement {
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
this.fuse.setCollection(this.apps);
if (!this.query) { if (!this.query) {
return; return;
} }