diff --git a/storybook/pages/StatusMessagePage.qml b/storybook/pages/StatusMessagePage.qml index 41668e7971..ddf8e45234 100644 --- a/storybook/pages/StatusMessagePage.qml +++ b/storybook/pages/StatusMessagePage.qml @@ -32,7 +32,6 @@ SplitView { isAReply: false trustIndicator: StatusContactVerificationIcons.TrustedType.Verified outgoingStatus: StatusMessage.OutgoingStatus.Delivered - requeestPaymentModel: [] } ListElement { timestamp: 1657937930135 diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index f966dfd25b..0272ccab33 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -391,7 +391,7 @@ Item { d.activeChatContentModule.inputAreaModule.setLinkPreviewEnabledForCurrentMessage(false) } onDismissLinkPreview: (index) => d.activeChatContentModule.inputAreaModule.removeLinkPreviewData(index) - onRemovePaymentRequest: (index) => d.activeChatContentModule.inputAreaModule.removePaymentRequestPreviewData(index) + onRemovePaymentRequestPreviewRequested: (index) => d.activeChatContentModule.inputAreaModule.removePaymentRequestPreviewData(index) } ChatPermissionQualificationPanel { diff --git a/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml b/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml index 2d452bbb30..27daf19e18 100644 --- a/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml +++ b/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml @@ -47,7 +47,7 @@ Control { signal linkReload(string link) signal linkClicked(string link) - signal removePaymentRequest(int index) + signal removePaymentRequestPreviewRequested(int index) signal enableLinkPreview() signal enableLinkPreviewForThisMessage() @@ -112,7 +112,7 @@ Control { amount: model.amount symbol: model.symbol - onClose: root.removePaymentRequest(model.index) + onClose: root.removePaymentRequestPreviewRequested(model.index) } } Repeater { diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 70b160a061..a88a51c4b1 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -37,7 +37,7 @@ Rectangle { signal disableLinkPreview() signal dismissLinkPreviewSettings() signal dismissLinkPreview(int index) - signal removePaymentRequest(int index) + signal removePaymentRequestPreviewRequested(int index) property var usersModel property SharedStores.RootStore sharedStore @@ -1244,7 +1244,7 @@ Rectangle { onDisableLinkPreview: () => control.disableLinkPreview() onDismissLinkPreviewSettings: () => control.dismissLinkPreviewSettings() onDismissLinkPreview: (index) => control.dismissLinkPreview(index) - onRemovePaymentRequest: (index) => control.removePaymentRequest(index) + onRemovePaymentRequestPreviewRequested: (index) => control.removePaymentRequestPreviewRequested(index) } RowLayout { diff --git a/ui/imports/shared/views/chat/LinksMessageView.qml b/ui/imports/shared/views/chat/LinksMessageView.qml index fbd1590091..b01c3544f9 100644 --- a/ui/imports/shared/views/chat/LinksMessageView.qml +++ b/ui/imports/shared/views/chat/LinksMessageView.qml @@ -40,7 +40,7 @@ Flow { signal imageClicked(var image, var mouse, string imageSource, string url) signal openContextMenu(var item, string url, string domain) signal setNeverAskAboutUnfurlingAgain(bool neverAskAgain) - signal paymentRequestClicked(var symbol, var amount, var receiver, var chainId) + signal paymentRequestClicked(int index) function resetLocalAskAboutUnfurling() { d.localAskAboutUnfurling = true @@ -75,7 +75,7 @@ Flow { senderName: root.senderName senderThumbnailImage: root.senderThumbnailImage senderColorId: root.senderColorId - onClicked: root.paymentRequestClicked(model.symbol, model.amount, model.receiver, model.chainId) + onClicked: root.paymentRequestClicked(model.index) } } diff --git a/ui/imports/shared/views/chat/MessageView.qml b/ui/imports/shared/views/chat/MessageView.qml index 6067588a72..99d3ad6361 100644 --- a/ui/imports/shared/views/chat/MessageView.qml +++ b/ui/imports/shared/views/chat/MessageView.qml @@ -992,7 +992,13 @@ Loader { gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain) - onPaymentRequestClicked: Global.paymentRequestClicked(receiver, symbol, amount, chainId) + onPaymentRequestClicked: (index) => { + const receiver = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "receiver") + const amount = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "amount") + const symbol = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "symbol") + const chainId = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "chainId") + Global.paymentRequestClicked(receiver, symbol, amount, chainId) + } Component.onCompleted: { root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId)