feat: Update store
This commit is contained in:
parent
b3342e5bb6
commit
f5d1ece74b
|
@ -66,7 +66,7 @@ StatusDialog {
|
|||
|
||||
readonly property var adaptor: TokenSelectorViewAdaptor {
|
||||
assetsModel: root.store.processedAssetsModel
|
||||
flatNetworksModel: root.flatNetworksModel
|
||||
flatNetworksModel: root.store.flatNetworksModel
|
||||
currentCurrency: root.store.currencyStore.currentCurrency
|
||||
plainTokensBySymbolModel: root.store.plainAssetsModel
|
||||
showAllTokens: true
|
||||
|
|
|
@ -25,6 +25,7 @@ import AppLayouts.Communities.popups 1.0
|
|||
import AppLayouts.Communities.panels 1.0
|
||||
import AppLayouts.Profile.stores 1.0 as ProfileStores
|
||||
import AppLayouts.Chat.stores 1.0 as ChatStores
|
||||
import AppLayouts.Wallet.stores 1.0 as WalletStore
|
||||
|
||||
import "../helpers"
|
||||
import "../controls"
|
||||
|
@ -294,6 +295,15 @@ Item {
|
|||
|
||||
usersModel: d.activeUsersStore.usersModel
|
||||
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
|
||||
urlsList: d.urlsList
|
||||
|
|
|
@ -34,7 +34,7 @@ Control {
|
|||
required property bool showLinkPreviewSettings
|
||||
|
||||
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 imageClicked(var chatImage)
|
||||
|
|
|
@ -1021,7 +1021,12 @@ Rectangle {
|
|||
|
||||
onAccepted: {
|
||||
control.requestPaymentStore.addPaymentRequest(selectedTokenKey, amount, selectedAccountAddress, selectedNetworkChainId)
|
||||
destroy()
|
||||
}
|
||||
|
||||
onRejected: destroy()
|
||||
|
||||
Component.onCompleted: d.requestPaymentPopup = null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,4 +6,16 @@ QtObject {
|
|||
required property var processedAssetsModel
|
||||
required property var plainAssetsModel
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue