fix(@desktop/communities): #5797 ensure member list from status go is not empty

This commit is contained in:
Iuri Matias 2022-05-17 16:27:42 -04:00
parent efb18f4851
commit 1b417dc5fd
1 changed files with 10 additions and 9 deletions

View File

@ -154,15 +154,16 @@ method onChatUpdated*(self: Module, chat: ChatDto) =
for member in chat.members:
self.addChatMember(self.controller.getChatMember(member.id))
let ids = self.view.model.getItemIds()
for id in ids:
var found = false
for member in chat.members:
if (member.id == id):
found = true
break
if (not found):
self.view.model().removeItemById(id)
if chat.members.len > 0:
let ids = self.view.model.getItemIds()
for id in ids:
var found = false
for member in chat.members:
if (member.id == id):
found = true
break
if (not found):
self.view.model().removeItemById(id)
method onChatMemberRemoved*(self: Module, id: string) =
self.view.model().removeItemById(id)