This commit is contained in:
Timothy Jaeryang Baek
2026-01-27 23:34:23 +04:00
parent fa859de460
commit 57ec2aa088

View File

@@ -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>