fix(category): fix missing category when empty (#14086)

Fixes https://github.com/status-im/status-desktop/issues/14059
This commit is contained in:
Jonathan Rainville 2024-03-22 12:55:40 -04:00 committed by GitHub
parent 05df5d1bce
commit e71d749ef2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -84,10 +84,14 @@ QtObject:
return self.items
proc categoryShouldBeHiddenBecauseNotPermitted(self: Model, categoryId: string): bool =
var catHasNoChannels = true
for i in 0 ..< self.items.len:
if not self.items[i].isCategory and self.items[i].categoryId == categoryId:
catHasNoChannels = false
if not self.items[i].hideBecausePermissionsAreNotMet():
return false
if catHasNoChannels:
return false
return true
proc itemShouldBeHiddenBecauseNotPermitted*(self: Model, item: Item): bool =