web/elements: keep selected elements in table when fetching (#7519)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
627b3bc095
commit
31592712a4
|
@ -194,7 +194,6 @@ export abstract class Table<T> extends AKElement {
|
|||
this.data = await this.apiEndpoint(this.page);
|
||||
this.error = undefined;
|
||||
this.page = this.data.pagination.current;
|
||||
const newSelected: T[] = [];
|
||||
const newExpanded: T[] = [];
|
||||
this.data.results.forEach((res) => {
|
||||
const jsonRes = JSON.stringify(res);
|
||||
|
@ -214,18 +213,12 @@ export abstract class Table<T> extends AKElement {
|
|||
);
|
||||
};
|
||||
}
|
||||
|
||||
const selectedIndex = this.selectedElements.findIndex(comp);
|
||||
if (selectedIndex > -1) {
|
||||
newSelected.push(res);
|
||||
}
|
||||
const expandedIndex = this.expandedElements.findIndex(comp);
|
||||
if (expandedIndex > -1) {
|
||||
newExpanded.push(res);
|
||||
}
|
||||
});
|
||||
this.isLoading = false;
|
||||
this.selectedElements = newSelected;
|
||||
this.expandedElements = newExpanded;
|
||||
} catch (ex) {
|
||||
this.isLoading = false;
|
||||
|
|
Reference in a new issue