mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 05:52:41 +00:00
9e70e69faf
Fixes #16602 This was broken when we refactored the members to use a single model for public channels. Those public channels then didn't have any members in their model they used for suggestions. This is fixed by putting the logic in the UsersStore and reusing that store whenever we need a list of the members.
36 lines
1.1 KiB
QML
36 lines
1.1 KiB
QML
import QtQuick 2.15
|
|
|
|
QtObject {
|
|
id: root
|
|
|
|
property var chatCommunitySectionModule
|
|
property var chatDetails
|
|
property var usersModule
|
|
|
|
readonly property var usersModel: {
|
|
if (!chatDetails && !chatCommunitySectionModule) {
|
|
return null
|
|
}
|
|
let isFullCommunityList = !chatDetails.requiresPermissions
|
|
if (chatDetails.belongsToCommunity && isFullCommunityList && !!chatCommunitySectionModule) {
|
|
// Community channel with no permisisons. We can use the section's membersModel
|
|
return chatCommunitySectionModule.membersModel
|
|
}
|
|
return usersModule ? usersModule.model : null
|
|
}
|
|
readonly property var temporaryModel: usersModule ? usersModule.temporaryModel : null
|
|
|
|
function appendTemporaryModel(pubKey, displayName) {
|
|
usersModule.appendTemporaryModel(pubKey, displayName)
|
|
}
|
|
function removeFromTemporaryModel(pubKey) {
|
|
usersModule.removeFromTemporaryModel(pubKey)
|
|
}
|
|
function resetTemporaryModel() {
|
|
usersModule.resetTemporaryModel()
|
|
}
|
|
function updateGroupMembers() {
|
|
usersModule.updateGroupMembers()
|
|
}
|
|
}
|