refac: align the admin Users tab counts with the workspace tab count behavior

This commit is contained in:
silentoplayz 2026-08-27 03:34:57 -04:00
parent 56d296ef1b
commit 37cde28513
2 changed files with 8 additions and 2 deletions

View file

@ -25,6 +25,10 @@
scrollToTab(selectedTab);
}
$: if (loaded && selectedTab) {
loadCounts();
}
const scrollToTab = (tabId) => {
const tabElement = document.getElementById(tabId);
if (tabElement) {
@ -58,7 +62,6 @@
await goto('/');
}
await loadCounts();
loaded = true;
const containerElement = document.getElementById('users-tabs-container');

View file

@ -48,6 +48,10 @@
return (b.member_count ?? 0) - (a.member_count ?? 0) || a.name.localeCompare(b.name);
});
$: if (loaded) {
adminGroupCount.set(filteredGroups.length);
}
/** @type {any} */
let defaultPermissions = {};
@ -56,7 +60,6 @@
const setGroups = async () => {
groups = await getGroups(localStorage.token);
adminGroupCount.set(groups.length);
};
/** @param {any} updatedGroup */