fix(@desktop/communities): #5797 ensure member list from status go is not empty
This commit is contained in:
parent
efb18f4851
commit
1b417dc5fd
|
@ -154,15 +154,16 @@ method onChatUpdated*(self: Module, chat: ChatDto) =
|
||||||
for member in chat.members:
|
for member in chat.members:
|
||||||
self.addChatMember(self.controller.getChatMember(member.id))
|
self.addChatMember(self.controller.getChatMember(member.id))
|
||||||
|
|
||||||
let ids = self.view.model.getItemIds()
|
if chat.members.len > 0:
|
||||||
for id in ids:
|
let ids = self.view.model.getItemIds()
|
||||||
var found = false
|
for id in ids:
|
||||||
for member in chat.members:
|
var found = false
|
||||||
if (member.id == id):
|
for member in chat.members:
|
||||||
found = true
|
if (member.id == id):
|
||||||
break
|
found = true
|
||||||
if (not found):
|
break
|
||||||
self.view.model().removeItemById(id)
|
if (not found):
|
||||||
|
self.view.model().removeItemById(id)
|
||||||
|
|
||||||
method onChatMemberRemoved*(self: Module, id: string) =
|
method onChatMemberRemoved*(self: Module, id: string) =
|
||||||
self.view.model().removeItemById(id)
|
self.view.model().removeItemById(id)
|
||||||
|
|
Loading…
Reference in New Issue