From aa5f861cb8a550e15a8c41e989f16626ca48bbbe Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Mon, 12 Jul 2021 10:35:05 +0200 Subject: [PATCH] fix(@desktop/profile): decline all request when big pending request list --- .../Chat/components/ContactRequestsPopup.qml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml b/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml index a71d9a920e..c43044b7f8 100644 --- a/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml +++ b/ui/app/AppLayouts/Chat/components/ContactRequestsPopup.qml @@ -62,9 +62,10 @@ ModalPopup { title: qsTr("Decline all contacts") confirmationText: qsTr("Are you sure you want to decline all these contact requests") onConfirmButtonClicked: { + const requests = profileModel.contacts.contactRequests const pubkeys = [] - for (let i = 0; i < contactList.count; i++) { - pubkeys.push(contactList.itemAtIndex(i).address) + for (let i = 0; i < requests.count; i++) { + pubkeys.push(requests.rowData(i, "address")) } profileModel.contacts.rejectContactRequests(JSON.stringify(pubkeys)) declineAllDialog.close() @@ -76,9 +77,10 @@ ModalPopup { title: qsTr("Accept all contacts") confirmationText: qsTr("Are you sure you want to accept all these contact requests") onConfirmButtonClicked: { + const requests = profileModel.contacts.contactRequests const pubkeys = [] - for (let i = 0; i < contactList.count; i++) { - pubkeys.push(contactList.itemAtIndex(i).address) + for (let i = 0; i < requests.count; i++) { + pubkeys.push(requests.rowData(i, "address")) } profileModel.contacts.acceptContactRequests(JSON.stringify(pubkeys)) acceptAllDialog.close()