fix(@desktop/chat): ensure proper limit when creating chat

This commit is contained in:
Patryk Osmaczko 2022-09-09 09:54:13 +02:00 committed by osmaczko
parent 7fad1ed5db
commit 52a34b21d0
2 changed files with 6 additions and 8 deletions

View File

@ -12,6 +12,8 @@ import SortFilterProxyModel 0.2
MembersSelectorBase {
id: root
limitReached: model.count >= membersLimit - 1 // -1 because creator is not on the list of members when creating chat
function cleanup() {
root.edit.clear()
d.selectedMembers.clear()

View File

@ -19,10 +19,12 @@ InlineSelectorPanel {
id: root
property var rootStore
readonly property bool limitReached: model.count >= d.membersLimit
readonly property int membersLimit: 20 // see: https://github.com/status-im/status-mobile/issues/13066
property bool limitReached: model.count >= membersLimit
label.text: qsTr("To:")
warningLabel.text: qsTr("%1 USER LIMIT REACHED").arg(d.membersLimit)
warningLabel.text: qsTr("%1 USER LIMIT REACHED").arg(membersLimit)
warningLabel.visible: limitReached
suggestionsModel: SortFilterProxyModel {
@ -67,12 +69,6 @@ InlineSelectorPanel {
onClicked: root.entryAccepted(this)
}
QtObject {
id: d
readonly property int membersLimit: 20 // see: https://github.com/status-im/status-mobile/issues/13066
}
Component.onCompleted: {
root.edit.forceActiveFocus()
}