mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
refac
This commit is contained in:
parent
fa859de460
commit
57ec2aa088
1 changed files with 12 additions and 7 deletions
|
|
@ -38,6 +38,8 @@
|
|||
let total = null;
|
||||
|
||||
let query = '';
|
||||
let debounceTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
let orderBy = 'name'; // default sort key
|
||||
let direction = 'asc'; // default sort order
|
||||
|
||||
|
|
@ -77,13 +79,16 @@
|
|||
}
|
||||
};
|
||||
|
||||
$: if (
|
||||
channel !== null &&
|
||||
page !== null &&
|
||||
query !== null &&
|
||||
orderBy !== null &&
|
||||
direction !== null
|
||||
) {
|
||||
// Debounce only query changes
|
||||
$: if (query !== undefined && channel !== null) {
|
||||
clearTimeout(debounceTimer);
|
||||
debounceTimer = setTimeout(() => {
|
||||
getUserList();
|
||||
}, 300);
|
||||
}
|
||||
|
||||
// Immediate response to page/sort changes
|
||||
$: if (channel !== null && page && orderBy && direction) {
|
||||
getUserList();
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue