Skip to content

Commit

Permalink
fix: conditional show/hide settings subscription section
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Oct 25, 2024
1 parent 2d7032f commit fb6246e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions frontend/src/components/Settings/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const tabs = computed(() => {
},
{
label: __('Subscription'),
condition: () => window.subscription_conf,
items: [
{
label: 'Plans',
Expand Down Expand Up @@ -117,14 +118,15 @@ const tabs = computed(() => {
},
]
return _tabs.map((tab) => {
tab.items = tab.items.filter((item) => {
if (item.condition) {
return item.condition()
}
return true
})
return tab
return _tabs.filter((tab) => {
if (tab.condition && !tab.condition()) return false
if (tab.items) {
tab.items = tab.items.filter((item) => {
if (item.condition && !item.condition()) return false
return true
})
}
return true
})
})
Expand Down

0 comments on commit fb6246e

Please sign in to comment.