From 12d70ebff9ac34b1a26db3b90d8e3ca8c5506986 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 23 Jan 2025 18:14:26 +0530 Subject: [PATCH] fix: condition --- .../dashboard/components-next/sidebar/SidebarGroup.vue | 2 +- .../dashboard/components-next/sidebar/SidebarGroupLeaf.vue | 2 +- .../dashboard/components-next/sidebar/SidebarSubGroup.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue b/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue index e84a18fb8..305171d10 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarGroup.vue @@ -42,7 +42,7 @@ const hasChildren = computed( const accessibleItems = computed(() => { if (!hasChildren.value) return []; return props.children.filter(child => { - if (child.showOnlyOnCloud && isOnChatwootCloud.value) return false; + if (child.showOnlyOnCloud && !isOnChatwootCloud.value) return false; // If a item has no link, it means it's just a subgroup header // So we don't need to check for permissions here, because there's nothing to // access here anyway diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarGroupLeaf.vue b/app/javascript/dashboard/components-next/sidebar/SidebarGroupLeaf.vue index 94ca7bd78..a791953b6 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarGroupLeaf.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarGroupLeaf.vue @@ -17,7 +17,7 @@ const { resolvePermissions, resolveFeatureFlag, isOnChatwootCloud } = useSidebarContext(); const allowedToShow = computed(() => { - if (props.showOnlyOnCloud && isOnChatwootCloud) return false; + if (props.showOnlyOnCloud && !isOnChatwootCloud.value) return false; return true; }); diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue b/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue index f70293af2..a938a202e 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue @@ -20,7 +20,7 @@ const scrollableContainer = ref(null); const accessibleItems = computed(() => props.children.filter(child => { - if (child.showOnlyOnCloud && isOnChatwootCloud.value) return false; + if (child.showOnlyOnCloud && !isOnChatwootCloud.value) return false; return child.to && isAllowed(child.to); }) );