refac: align the admin Users tab counts with the workspace tab count behavior (#29080)
This commit is contained in:
2 files changed
+8
-2
No files matched your search
@@ -25,6 +25,10 @@
|
|||||||
scrollToTab(selectedTab);
|
scrollToTab(selectedTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: if (loaded && selectedTab) {
|
||||||
|
loadCounts();
|
||||||
|
}
|
||||||
|
|
||||||
const scrollToTab = (tabId) => {
|
const scrollToTab = (tabId) => {
|
||||||
const tabElement = document.getElementById(tabId);
|
const tabElement = document.getElementById(tabId);
|
||||||
if (tabElement) {
|
if (tabElement) {
|
||||||
@@ -58,7 +62,6 @@
|
|||||||
await goto('/');
|
await goto('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
await loadCounts();
|
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
const containerElement = document.getElementById('users-tabs-container');
|
const containerElement = document.getElementById('users-tabs-container');
|
||||||
|
|||||||
@@ -48,6 +48,10 @@
|
|||||||
return (b.member_count ?? 0) - (a.member_count ?? 0) || a.name.localeCompare(b.name);
|
return (b.member_count ?? 0) - (a.member_count ?? 0) || a.name.localeCompare(b.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$: if (loaded) {
|
||||||
|
adminGroupCount.set(filteredGroups.length);
|
||||||
|
}
|
||||||
|
|
||||||
/** @type {any} */
|
/** @type {any} */
|
||||||
let defaultPermissions = {};
|
let defaultPermissions = {};
|
||||||
|
|
||||||
@@ -56,7 +60,6 @@
|
|||||||
|
|
||||||
const setGroups = async () => {
|
const setGroups = async () => {
|
||||||
groups = await getGroups(localStorage.token);
|
groups = await getGroups(localStorage.token);
|
||||||
adminGroupCount.set(groups.length);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @param {any} updatedGroup */
|
/** @param {any} updatedGroup */
|
||||||
|
|||||||
Reference in new issue
Block a user