fix(CurrencyStore): fix passing the CurrencyStore around

- now that we no longer have them as singletons, just pass the one and
only instance down from AppMain
This commit is contained in:
Lukáš Tinkl 2024-10-04 12:04:59 +02:00 committed by Lukáš Tinkl
parent 235162dc01
commit 63fb79abd6
6 changed files with 15 additions and 7 deletions

View File

@ -18,7 +18,7 @@ QtObject {
property ContactsStore contactsStore
property CommunityTokensStore communityTokensStore
property WalletStore.RootStore walletStore
property CurrenciesStore currencyStore
property NetworkConnectionStore networkConnectionStore
readonly property PermissionsStore permissionsStore: PermissionsStore {
@ -535,7 +535,6 @@ QtObject {
// Needed for TX in chat for stickers and via contact
readonly property var accounts: walletSectionAccounts.accounts
property string currentCurrency: walletSection.currentCurrency
property CurrenciesStore currencyStore: CurrenciesStore {}
property var savedAddressesModel: walletSectionSavedAddresses.model
property var disabledChainIdsFromList: []

View File

@ -432,7 +432,7 @@ QtObject {
walletSectionAccounts.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance)
}
property SharedStores.CurrenciesStore currencyStore: SharedStores.CurrenciesStore {}
property SharedStores.CurrenciesStore currencyStore: SharedStores.CurrenciesStore {} // FIXME pass it down from AppMain instead of recreating it here
function addressWasShown(address) {
return d.mainModuleInst.addressWasShown(address)

View File

@ -427,6 +427,7 @@ RightTabBaseView {
overview: RootStore.overview
walletRootStore: RootStore
communitiesStore: root.communitiesStore
currencyStore: root.sharedRootStore.currencyStore
showAllAccounts: RootStore.showAllAccounts
sendModal: root.sendModal
filterVisible: filterButton.checked

View File

@ -57,13 +57,16 @@ Item {
property alias appLayout: appLayout
readonly property SharedStores.RootStore sharedRootStore: SharedStores.RootStore {}
readonly property SharedStores.RootStore sharedRootStore: SharedStores.RootStore {
currencyStore: appMain.currencyStore
}
property AppStores.RootStore rootStore: AppStores.RootStore {
profileSectionStore.sendModalPopup: sendModal
}
property ChatStores.RootStore rootChatStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened
@ -1361,6 +1364,7 @@ Item {
sharedRootStore: appMain.sharedRootStore
rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened
@ -1520,6 +1524,7 @@ Item {
sharedRootStore: appMain.sharedRootStore
rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened
@ -1565,6 +1570,7 @@ Item {
sharedRootStore: appMain.sharedRootStore
rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened
@ -1589,6 +1595,7 @@ Item {
height: appView.height - _buttonSize * 2
store: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore
currencyStore: appMain.currencyStore
communityTokensStore: appMain.communityTokensStore
emojiReactionsModel: appMain.rootStore.emojiReactionsModel
openCreateChat: createChatView.opened

View File

@ -17,7 +17,7 @@ QtObject {
property bool neverAskAboutUnfurlingAgain: !!accountSensitiveSettings ? accountSensitiveSettings.neverAskAboutUnfurlingAgain : false
property bool gifUnfurlingEnabled: !!accountSensitiveSettings ? accountSensitiveSettings.gifUnfurlingEnabled : false
property CurrenciesStore currencyStore: CurrenciesStore {}
required property CurrenciesStore currencyStore
property TokenMarketValuesStore marketValueStore: TokenMarketValuesStore {}

View File

@ -34,6 +34,7 @@ ColumnLayout {
property WalletStores.RootStore walletRootStore
property CommunitiesStore communitiesStore
property CurrenciesStore currencyStore
property bool showAllAccounts: false
property bool displayValues: true
property var sendModal
@ -490,7 +491,7 @@ ColumnLayout {
modelData: transactionDelegate.model.activityEntry
timeStampText: isModelDataValid ? LocaleUtils.formatRelativeTimestamp(modelData.timestamp * 1000, true) : ""
flatNetworks: root.walletRootStore.flatNetworks
currenciesStore: RootStore.currencyStore
currenciesStore: root.currencyStore
walletRootStore: root.walletRootStore
showAllAccounts: root.showAllAccounts
displayValues: root.displayValues
@ -555,7 +556,7 @@ ColumnLayout {
Layout.fillWidth: true
flatNetworks: root.walletRootStore.flatNetworks
currenciesStore: RootStore.currencyStore
currenciesStore: root.currencyStore
walletRootStore: root.walletRootStore
loading: true
}