Fix app count in groups list

This commit is contained in:
Andrew Kingston 2024-10-22 15:33:21 +01:00
parent 62d87da024
commit 80e532f59d
No known key found for this signature in database
1 changed files with 4 additions and 3 deletions

View File

@ -4,15 +4,16 @@
export let value
export let row
$: count = getCount(Object.keys(value || {}).length)
const getCount = () => {
$: count = getCount(row, value)
const getCount = (row, value) => {
return sdk.users.hasAppBuilderPermissions(row)
? row.builder.apps.length +
Object.keys(row.roles || {}).filter(appId =>
row.builder.apps.includes(appId)
).length
: value?.length || 0
: Object.keys(value || {}).length
}
</script>