fix: condition

This commit is contained in:
Shivam Mishra
2025-01-23 18:14:26 +05:30
parent eff39fbbf5
commit 12d70ebff9
3 changed files with 3 additions and 3 deletions
@@ -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
@@ -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;
});
@@ -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);
})
);