fix: fix joblist continuous scroll buildup when refreshing

This commit is contained in:
Christoph Kluge 2025-06-05 15:19:00 +02:00
parent 24cf5047da
commit 0a24ef70e0

View File

@ -113,11 +113,6 @@
variables: { paging, sorting, filter }, variables: { paging, sorting, filter },
}); });
$: if (!usePaging && sorting) {
// console.log('Reset Paging ...')
paging = { itemsPerPage: 10, page: 1 }
};
let jobs = []; let jobs = [];
$: if ($initialized && $jobsStore.data) { $: if ($initialized && $jobsStore.data) {
if (usePaging) { if (usePaging) {
@ -143,10 +138,20 @@
} }
} }
$: if (!usePaging && (sorting || filter)) {
// Continous Scroll: Reset list and paging if parameters change: Existing entries will not match new selections
jobs = [];
paging = { itemsPerPage: 10, page: 1 };
}
$: matchedListJobs = $jobsStore.data != null ? $jobsStore.data.jobs.count : -1; $: matchedListJobs = $jobsStore.data != null ? $jobsStore.data.jobs.count : -1;
// Force refresh list with existing unchanged variables (== usually would not trigger reactivity) // Force refresh list with existing unchanged variables (== usually would not trigger reactivity)
export function refreshJobs() { export function refreshJobs() {
if (!usePaging) {
jobs = []; // Empty Joblist before refresh, prevents infinite buildup
paging = { itemsPerPage: 10, page: 1 };
}
jobsStore = queryStore({ jobsStore = queryStore({
client: client, client: client,
query: query, query: query,