diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue b/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue index 881034b4c..8e99977dd 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarAccountSwitcher.vue @@ -56,10 +56,10 @@ const emitNewAccount = () => {
{{ t('SIDEBAR_ITEMS.CHANGE_ACCOUNTS') }}
@@ -73,12 +73,19 @@ const emitNewAccount = () => { >
- + {{ account.name }} - +
+ {{ account.custom_role_id ? account.custom_role.name @@ -93,9 +100,8 @@ const emitNewAccount = () => { />
-
+
{ - parentEl.value?.querySelectorAll('.child-item').forEach((child, index) => { - if (index === parentEl.value.querySelectorAll('.child-item').length - 1) { - child.classList.add('last-child-item'); - } +const locateLastChild = async () => { + const children = parentEl.value?.querySelectorAll('.child-item'); + if (!children) return; + + children.forEach((child, index) => { + child.classList.toggle('last-child-item', index === children.length - 1); }); }; @@ -103,7 +104,7 @@ const toggleTrigger = () => { setExpandedItem(props.name); }; -watch(expandedItem, locateLastChild, { +watch([expandedItem, accessibleItems], locateLastChild, { immediate: true, });