feat: Code review remarks

This commit is contained in:
Emil Sawicki 2024-11-26 22:20:36 +01:00
parent 04341f0321
commit 9c3914ab1d
6 changed files with 14 additions and 9 deletions

View File

@ -32,7 +32,6 @@ SplitView {
isAReply: false isAReply: false
trustIndicator: StatusContactVerificationIcons.TrustedType.Verified trustIndicator: StatusContactVerificationIcons.TrustedType.Verified
outgoingStatus: StatusMessage.OutgoingStatus.Delivered outgoingStatus: StatusMessage.OutgoingStatus.Delivered
requeestPaymentModel: []
} }
ListElement { ListElement {
timestamp: 1657937930135 timestamp: 1657937930135

View File

@ -391,7 +391,7 @@ Item {
d.activeChatContentModule.inputAreaModule.setLinkPreviewEnabledForCurrentMessage(false) d.activeChatContentModule.inputAreaModule.setLinkPreviewEnabledForCurrentMessage(false)
} }
onDismissLinkPreview: (index) => d.activeChatContentModule.inputAreaModule.removeLinkPreviewData(index) onDismissLinkPreview: (index) => d.activeChatContentModule.inputAreaModule.removeLinkPreviewData(index)
onRemovePaymentRequest: (index) => d.activeChatContentModule.inputAreaModule.removePaymentRequestPreviewData(index) onRemovePaymentRequestPreviewRequested: (index) => d.activeChatContentModule.inputAreaModule.removePaymentRequestPreviewData(index)
} }
ChatPermissionQualificationPanel { ChatPermissionQualificationPanel {

View File

@ -47,7 +47,7 @@ Control {
signal linkReload(string link) signal linkReload(string link)
signal linkClicked(string link) signal linkClicked(string link)
signal removePaymentRequest(int index) signal removePaymentRequestPreviewRequested(int index)
signal enableLinkPreview() signal enableLinkPreview()
signal enableLinkPreviewForThisMessage() signal enableLinkPreviewForThisMessage()
@ -112,7 +112,7 @@ Control {
amount: model.amount amount: model.amount
symbol: model.symbol symbol: model.symbol
onClose: root.removePaymentRequest(model.index) onClose: root.removePaymentRequestPreviewRequested(model.index)
} }
} }
Repeater { Repeater {

View File

@ -37,7 +37,7 @@ Rectangle {
signal disableLinkPreview() signal disableLinkPreview()
signal dismissLinkPreviewSettings() signal dismissLinkPreviewSettings()
signal dismissLinkPreview(int index) signal dismissLinkPreview(int index)
signal removePaymentRequest(int index) signal removePaymentRequestPreviewRequested(int index)
property var usersModel property var usersModel
property SharedStores.RootStore sharedStore property SharedStores.RootStore sharedStore
@ -1244,7 +1244,7 @@ Rectangle {
onDisableLinkPreview: () => control.disableLinkPreview() onDisableLinkPreview: () => control.disableLinkPreview()
onDismissLinkPreviewSettings: () => control.dismissLinkPreviewSettings() onDismissLinkPreviewSettings: () => control.dismissLinkPreviewSettings()
onDismissLinkPreview: (index) => control.dismissLinkPreview(index) onDismissLinkPreview: (index) => control.dismissLinkPreview(index)
onRemovePaymentRequest: (index) => control.removePaymentRequest(index) onRemovePaymentRequestPreviewRequested: (index) => control.removePaymentRequestPreviewRequested(index)
} }
RowLayout { RowLayout {

View File

@ -40,7 +40,7 @@ Flow {
signal imageClicked(var image, var mouse, string imageSource, string url) signal imageClicked(var image, var mouse, string imageSource, string url)
signal openContextMenu(var item, string url, string domain) signal openContextMenu(var item, string url, string domain)
signal setNeverAskAboutUnfurlingAgain(bool neverAskAgain) signal setNeverAskAboutUnfurlingAgain(bool neverAskAgain)
signal paymentRequestClicked(var symbol, var amount, var receiver, var chainId) signal paymentRequestClicked(int index)
function resetLocalAskAboutUnfurling() { function resetLocalAskAboutUnfurling() {
d.localAskAboutUnfurling = true d.localAskAboutUnfurling = true
@ -75,7 +75,7 @@ Flow {
senderName: root.senderName senderName: root.senderName
senderThumbnailImage: root.senderThumbnailImage senderThumbnailImage: root.senderThumbnailImage
senderColorId: root.senderColorId senderColorId: root.senderColorId
onClicked: root.paymentRequestClicked(model.symbol, model.amount, model.receiver, model.chainId) onClicked: root.paymentRequestClicked(model.index)
} }
} }

View File

@ -992,7 +992,13 @@ Loader {
gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled
canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain
onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain) 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: { Component.onCompleted: {
root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId) root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId)