feat: Update store

This commit is contained in:
Emil Sawicki 2024-11-22 05:03:25 +01:00
parent b3342e5bb6
commit f5d1ece74b
5 changed files with 29 additions and 2 deletions

View File

@ -66,7 +66,7 @@ StatusDialog {
readonly property var adaptor: TokenSelectorViewAdaptor { readonly property var adaptor: TokenSelectorViewAdaptor {
assetsModel: root.store.processedAssetsModel assetsModel: root.store.processedAssetsModel
flatNetworksModel: root.flatNetworksModel flatNetworksModel: root.store.flatNetworksModel
currentCurrency: root.store.currencyStore.currentCurrency currentCurrency: root.store.currencyStore.currentCurrency
plainTokensBySymbolModel: root.store.plainAssetsModel plainTokensBySymbolModel: root.store.plainAssetsModel
showAllTokens: true showAllTokens: true

View File

@ -25,6 +25,7 @@ import AppLayouts.Communities.popups 1.0
import AppLayouts.Communities.panels 1.0 import AppLayouts.Communities.panels 1.0
import AppLayouts.Profile.stores 1.0 as ProfileStores import AppLayouts.Profile.stores 1.0 as ProfileStores
import AppLayouts.Chat.stores 1.0 as ChatStores import AppLayouts.Chat.stores 1.0 as ChatStores
import AppLayouts.Wallet.stores 1.0 as WalletStore
import "../helpers" import "../helpers"
import "../controls" import "../controls"
@ -294,6 +295,15 @@ Item {
usersModel: d.activeUsersStore.usersModel usersModel: d.activeUsersStore.usersModel
sharedStore: root.sharedRootStore sharedStore: root.sharedRootStore
requestPaymentStore: SharedStores.RequestPaymentStore {
currencyStore: root.rootStore.currencyStore
flatNetworksModel: WalletStore.RootStore.filteredFlatModel
processedAssetsModel: WalletStore.RootStore.walletAssetsStore.groupedAccountAssetsModel
plainAssetsModel: WalletStore.RootStore.tokensStore.plainTokensBySymbolModel
accountsModel: WalletStore.RootStore.nonWatchAccounts
requestPaymentModel: !!d.activeChatContentModule ? d.activeChatContentModule.inputAreaModule.paymentRequestModel : null
}
linkPreviewModel: !!d.activeChatContentModule ? d.activeChatContentModule.inputAreaModule.linkPreviewModel : null linkPreviewModel: !!d.activeChatContentModule ? d.activeChatContentModule.inputAreaModule.linkPreviewModel : null
urlsList: d.urlsList urlsList: d.urlsList

View File

@ -34,7 +34,7 @@ Control {
required property bool showLinkPreviewSettings required property bool showLinkPreviewSettings
readonly property alias hoveredUrl: d.hoveredUrl readonly property alias hoveredUrl: d.hoveredUrl
readonly property bool hasContent: imagePreviewArray.length > 0 || showLinkPreviewSettings || linkPreviewRepeater.count > 0 readonly property bool hasContent: imagePreviewArray.length > 0 || showLinkPreviewSettings || linkPreviewRepeater.count > 0 || requestPaymentRepeater.count > 0
signal imageRemoved(int index) signal imageRemoved(int index)
signal imageClicked(var chatImage) signal imageClicked(var chatImage)

View File

@ -1021,7 +1021,12 @@ Rectangle {
onAccepted: { onAccepted: {
control.requestPaymentStore.addPaymentRequest(selectedTokenKey, amount, selectedAccountAddress, selectedNetworkChainId) control.requestPaymentStore.addPaymentRequest(selectedTokenKey, amount, selectedAccountAddress, selectedNetworkChainId)
destroy()
} }
onRejected: destroy()
Component.onCompleted: d.requestPaymentPopup = null
} }
} }

View File

@ -6,4 +6,16 @@ QtObject {
required property var processedAssetsModel required property var processedAssetsModel
required property var plainAssetsModel required property var plainAssetsModel
required property var accountsModel required property var accountsModel
property var requestPaymentModel: null
function addPaymentRequest(symbol, amount, address, chainId) {
if (!requestPaymentModel)
return
requestPaymentModel.addPaymentRequest(address, amount, symbol, chainId)
}
function removePaymentRequest(index) {
requestPaymentModel.removeItemWithIndex(index)
}
} }