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

View File

@ -432,7 +432,7 @@ QtObject {
walletSectionAccounts.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) 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) { function addressWasShown(address) {
return d.mainModuleInst.addressWasShown(address) return d.mainModuleInst.addressWasShown(address)

View File

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

View File

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

View File

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

View File

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