feat: Disable request payment for testnet

This commit is contained in:
Emil Sawicki 2024-11-11 15:04:53 +01:00
parent 889c94bd29
commit 486bc99abb
5 changed files with 10 additions and 6 deletions

View File

@ -147,14 +147,14 @@ SplitView {
walletTokensStore: WalletStores.TokensStore {
plainTokensBySymbolModel: TokensBySymbolModel {}
}
readonly property var baseGroupedAccountAssetModel: GroupedAccountsAssetsModel {}
assetsWithFilteredBalances: thisWalletAssetStore.groupedAccountsAssetsModel
}
readonly property SharedStores.RequestPaymentStore requestPaymentStore: SharedStores.RequestPaymentStore {
currencyStore: SharedStores.CurrenciesStore {}
flatNetworksModel: NetworksModel.flatNetworks
processedAssetsModel: d.walletAssetsStore.renamedTokensBySymbolModel
processedAssetsModel: d.walletAssetsStore.jointModel
plainAssetsModel: d.walletAssetsStore.walletTokensStore.plainTokensBySymbolModel
accountsModel: WalletAccountsModel {}
}

View File

@ -36,6 +36,7 @@ StackLayout {
required property SendStores.TransactionStore transactionStore
required property WalletStore.WalletAssetsStore walletAssetsStore
required property SharedStores.CurrenciesStore currencyStore
property bool areTestNetworksEnabled
property var sectionItemModel

View File

@ -46,6 +46,7 @@ Item {
property ProfileStores.ContactsStore contactsStore
property var emojiPopup
property var stickersPopup
property bool areTestNetworksEnabled
property string activeChatId: parentModule && parentModule.activeItem.id
property int chatsCount: parentModule && parentModule.model ? parentModule.model.count : 0
@ -323,6 +324,7 @@ Item {
emojiPopup: root.emojiPopup
stickersPopup: root.stickersPopup
chatType: root.activeChatType
areTestNetworksEnabled: root.areTestNetworksEnabled
textInput.onTextChanged: {
if (!!d.activeChatContentModule && textInput.text !== d.activeChatContentModule.inputAreaModule.preservedProperties.text) {

View File

@ -51,6 +51,7 @@ StatusSectionLayout {
required property var sendModalPopup
property var sectionItemModel
property int joinedMembersCount
property bool areTestNetworksEnabled
property var emojiPopup
property var stickersPopup
@ -270,6 +271,7 @@ StatusSectionLayout {
sharedRootStore: root.sharedRootStore
utilsStore: root.utilsStore
rootStore: root.rootStore
areTestNetworksEnabled: root.areTestNetworksEnabled
createChatPropertiesStore: root.createChatPropertiesStore
contactsStore: root.contactsStore
stickersLoaded: root.stickersLoaded

View File

@ -48,6 +48,7 @@ Rectangle {
property var stickersPopup: null
// Use this to only enable the Connections only when this Input opens the Emoji popup
property bool closeGifPopupAfterSelection: true
property bool areTestNetworksEnabled
property bool emojiEvent: false
property bool isColonPressed: false
@ -1034,8 +1035,8 @@ Rectangle {
StatusAction {
text: qsTr("Add payment request")
icon.name: "wallet"
// TODO_ES disable for testnet (only production)
// TODO_ES error message when disabled on testnet (only production)
visibleOnDisabled: true
enabled: !root.areTestNetworksEnabled
onTriggered: control.openPaymentRequestPopup()
}
@ -1273,7 +1274,6 @@ Rectangle {
topPadding: 12
imagePreviewArray: control.fileUrlsAndSources
linkPreviewModel: control.linkPreviewModel
requestPaymentModel: control.requestPaymentStore.requestPaymentModel
showLinkPreviewSettings: control.askToEnableLinkPreview
onImageRemoved: (index) => {
//Just do a copy and replace the whole thing because it's a plain JS array and thre's no signal when a single item is removed
@ -1292,7 +1292,6 @@ Rectangle {
onDisableLinkPreview: () => control.disableLinkPreview()
onDismissLinkPreviewSettings: () => control.dismissLinkPreviewSettings()
onDismissLinkPreview: (index) => control.dismissLinkPreview(index)
onPaymentRequestRemoved: (index) => control.requestPaymentStore.removePaymentRequest(index)
}
RowLayout {