stores: access shared/RootStore via explicit property instead of singleton

This commit is contained in:
Michał Cieślak 2024-10-02 22:47:14 +02:00 committed by Michał
parent dd871c7e34
commit 2af0d6668b
18 changed files with 90 additions and 46 deletions

View File

@ -4,8 +4,8 @@ import QtQuick.Layouts 1.14
import utils 1.0 import utils 1.0
import shared.popups 1.0 import shared.popups 1.0
import shared.stores 1.0 import shared.stores 1.0 as SharedStores
import shared.stores.send 1.0 import shared.stores.send 1.0 as SendStores
import "views" import "views"
@ -14,8 +14,8 @@ import AppLayouts.Communities.popups 1.0
import AppLayouts.Communities.helpers 1.0 import AppLayouts.Communities.helpers 1.0
import AppLayouts.Communities.stores 1.0 as CommunitiesStores import AppLayouts.Communities.stores 1.0 as CommunitiesStores
import AppLayouts.Chat.stores 1.0 import AppLayouts.Chat.stores 1.0 as ChatStores
import AppLayouts.Profile.stores 1.0 import AppLayouts.Profile.stores 1.0 as ProfileStores
import AppLayouts.Wallet.stores 1.0 as WalletStore import AppLayouts.Wallet.stores 1.0 as WalletStore
import StatusQ.Core.Utils 0.1 import StatusQ.Core.Utils 0.1
@ -23,15 +23,16 @@ import StatusQ.Core.Utils 0.1
StackLayout { StackLayout {
id: root id: root
property RootStore rootStore property SharedStores.RootStore sharedRootStore
property CreateChatPropertiesStore createChatPropertiesStore property ChatStores.RootStore rootStore
readonly property ContactsStore contactsStore: rootStore.contactsStore property ChatStores.CreateChatPropertiesStore createChatPropertiesStore
readonly property PermissionsStore permissionsStore: rootStore.permissionsStore readonly property ProfileStores.ContactsStore contactsStore: rootStore.contactsStore
readonly property SharedStores.PermissionsStore permissionsStore: rootStore.permissionsStore
property CommunitiesStores.CommunitiesStore communitiesStore property CommunitiesStores.CommunitiesStore communitiesStore
required property WalletStore.TokensStore tokensStore required property WalletStore.TokensStore tokensStore
required property TransactionStore transactionStore required property SendStores.TransactionStore transactionStore
required property WalletStore.WalletAssetsStore walletAssetsStore required property WalletStore.WalletAssetsStore walletAssetsStore
required property CurrenciesStore currencyStore required property SharedStores.CurrenciesStore currencyStore
property var sectionItemModel property var sectionItemModel
property var sendModalPopup property var sendModalPopup
@ -148,6 +149,7 @@ StackLayout {
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
stickersPopup: root.stickersPopup stickersPopup: root.stickersPopup
contactsStore: root.contactsStore contactsStore: root.contactsStore
sharedRootStore: root.sharedRootStore
rootStore: root.rootStore rootStore: root.rootStore
transactionStore: root.transactionStore transactionStore: root.transactionStore
createChatPropertiesStore: root.createChatPropertiesStore createChatPropertiesStore: root.createChatPropertiesStore

View File

@ -12,12 +12,14 @@ import StatusQ.Popups.Dialog 0.1
import utils 1.0 import utils 1.0
import shared.views.chat 1.0 import shared.views.chat 1.0
import shared.stores 1.0 as SharedStores
import AppLayouts.Chat.stores 1.0 import AppLayouts.Chat.stores 1.0
StatusDialog { StatusDialog {
id: root id: root
property SharedStores.RootStore sharedStore
property RootStore store property RootStore store
property MessageStore messageStore property MessageStore messageStore
property var pinnedMessagesModel //this doesn't belong to the messageStore, it is a part of the ChatContentStore, but we didn't introduce it yet. property var pinnedMessagesModel //this doesn't belong to the messageStore, it is a part of the ChatContentStore, but we didn't introduce it yet.
@ -77,6 +79,7 @@ StatusDialog {
width: parent.width width: parent.width
sharedRootStore: root.sharedStore
rootStore: root.store rootStore: root.store
messageStore: root.messageStore messageStore: root.messageStore

View File

@ -39,6 +39,7 @@ Item {
// don't follow struct we have on the backend. // don't follow struct we have on the backend.
property var parentModule property var parentModule
property SharedStores.RootStore sharedRootStore
property RootStore rootStore property RootStore rootStore
property CreateChatPropertiesStore createChatPropertiesStore property CreateChatPropertiesStore createChatPropertiesStore
property ContactsStore contactsStore property ContactsStore contactsStore
@ -234,6 +235,7 @@ Item {
chatId: model.itemId chatId: model.itemId
chatType: model.type chatType: model.type
chatMessagesLoader.active: model.loaderActive chatMessagesLoader.active: model.loaderActive
sharedRootStore: root.sharedRootStore
rootStore: root.rootStore rootStore: root.rootStore
contactsStore: root.contactsStore contactsStore: root.contactsStore
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
@ -290,7 +292,7 @@ Item {
store: root.rootStore store: root.rootStore
usersModel: d.activeUsersStore.usersModel usersModel: d.activeUsersStore.usersModel
sharedStore: SharedStores.RootStore sharedStore: root.sharedRootStore
linkPreviewModel: !!d.activeChatContentModule ? d.activeChatContentModule.inputAreaModule.linkPreviewModel : null linkPreviewModel: !!d.activeChatContentModule ? d.activeChatContentModule.inputAreaModule.linkPreviewModel : null
urlsList: d.urlsList urlsList: d.urlsList

View File

@ -10,6 +10,7 @@ import StatusQ.Controls 0.1
import utils 1.0 import utils 1.0
import shared 1.0 import shared 1.0
import shared.stores 1.0 as SharedStores
import shared.popups 1.0 import shared.popups 1.0
import shared.status 1.0 import shared.status 1.0
import shared.controls 1.0 import shared.controls 1.0
@ -30,6 +31,7 @@ ColumnLayout {
// Important: each chat/channel has its own ChatContentModule // Important: each chat/channel has its own ChatContentModule
property var chatContentModule property var chatContentModule
property var chatSectionModule property var chatSectionModule
property SharedStores.RootStore sharedRootStore
property RootStore rootStore property RootStore rootStore
property ContactsStore contactsStore property ContactsStore contactsStore
property string chatId property string chatId
@ -81,6 +83,8 @@ ColumnLayout {
sourceComponent: ChatMessagesView { sourceComponent: ChatMessagesView {
chatContentModule: root.chatContentModule chatContentModule: root.chatContentModule
sharedRootStore: root.sharedRootStore
rootStore: root.rootStore rootStore: root.rootStore
contactsStore: root.contactsStore contactsStore: root.contactsStore
messageStore: root.messageStore messageStore: root.messageStore

View File

@ -12,6 +12,7 @@ import StatusQ.Core.Theme 0.1
import utils 1.0 import utils 1.0
import shared 1.0 import shared 1.0
import shared.stores 1.0 as SharedStores
import shared.views 1.0 import shared.views 1.0
import shared.panels 1.0 import shared.panels 1.0
import shared.popups 1.0 import shared.popups 1.0
@ -29,6 +30,8 @@ Item {
id: root id: root
property var chatContentModule property var chatContentModule
property SharedStores.RootStore sharedRootStore
property RootStore rootStore property RootStore rootStore
property MessageStore messageStore property MessageStore messageStore
property UsersStore usersStore property UsersStore usersStore
@ -266,6 +269,8 @@ Item {
width: ListView.view.width width: ListView.view.width
objectName: "chatMessageViewDelegate" objectName: "chatMessageViewDelegate"
sharedRootStore: root.sharedRootStore
rootStore: root.rootStore rootStore: root.rootStore
messageStore: root.messageStore messageStore: root.messageStore
usersStore: root.usersStore usersStore: root.usersStore

View File

@ -7,9 +7,9 @@ import shared 1.0
import shared.panels 1.0 import shared.panels 1.0
import shared.popups 1.0 import shared.popups 1.0
import shared.status 1.0 import shared.status 1.0
import shared.stores 1.0 import shared.stores 1.0 as SharedStores
import shared.views.chat 1.0 import shared.views.chat 1.0
import shared.stores.send 1.0 import shared.stores.send 1.0 as SendStores
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2
import StatusQ.Core 0.1 import StatusQ.Core 0.1
@ -29,10 +29,12 @@ import AppLayouts.Communities.views 1.0
import AppLayouts.Profile.stores 1.0 import AppLayouts.Profile.stores 1.0
import AppLayouts.Wallet.stores 1.0 as WalletStore import AppLayouts.Wallet.stores 1.0 as WalletStore
import AppLayouts.Chat.stores 1.0 as ChatStores
import "../popups" import "../popups"
import "../helpers" import "../helpers"
import "../controls" import "../controls"
import "../stores"
StatusSectionLayout { StatusSectionLayout {
id: root id: root
@ -40,12 +42,13 @@ StatusSectionLayout {
property ContactsStore contactsStore property ContactsStore contactsStore
property bool hasAddedContacts: contactsStore.myContactsModel.count > 0 property bool hasAddedContacts: contactsStore.myContactsModel.count > 0
property RootStore rootStore property SharedStores.RootStore sharedRootStore
required property TransactionStore transactionStore property ChatStores.RootStore rootStore
property CreateChatPropertiesStore createChatPropertiesStore required property SendStores.TransactionStore transactionStore
property ChatStores.CreateChatPropertiesStore createChatPropertiesStore
property CommunitiesStores.CommunitiesStore communitiesStore property CommunitiesStores.CommunitiesStore communitiesStore
required property WalletStore.WalletAssetsStore walletAssetsStore required property WalletStore.WalletAssetsStore walletAssetsStore
required property CurrenciesStore currencyStore required property SharedStores.CurrenciesStore currencyStore
property var sectionItemModel property var sectionItemModel
property var emojiPopup property var emojiPopup
@ -220,6 +223,7 @@ StatusSectionLayout {
ChatColumnView { ChatColumnView {
parentModule: root.rootStore.chatCommunitySectionModule parentModule: root.rootStore.chatCommunitySectionModule
sharedRootStore: root.sharedRootStore
rootStore: root.rootStore rootStore: root.rootStore
createChatPropertiesStore: root.createChatPropertiesStore createChatPropertiesStore: root.createChatPropertiesStore
contactsStore: root.contactsStore contactsStore: root.contactsStore

View File

@ -19,6 +19,7 @@ import AppLayouts.Chat.stores 1.0 as ChatStores
Page { Page {
id: root id: root
property SharedStores.RootStore sharedRootStore
property ChatStores.RootStore rootStore property ChatStores.RootStore rootStore
property ChatStores.CreateChatPropertiesStore createChatPropertiesStore property ChatStores.CreateChatPropertiesStore createChatPropertiesStore
property var emojiPopup: null property var emojiPopup: null
@ -162,7 +163,7 @@ Page {
stickersPopup: root.stickersPopup stickersPopup: root.stickersPopup
closeGifPopupAfterSelection: true closeGifPopupAfterSelection: true
usersModel: membersSelector.model usersModel: membersSelector.model
sharedStore: SharedStores.RootStore sharedStore: root.sharedRootStore
onStickerSelected: { onStickerSelected: {
root.createChatPropertiesStore.createChatStickerHashId = hashId; root.createChatPropertiesStore.createChatStickerHashId = hashId;
root.createChatPropertiesStore.createChatStickerPackId = packId; root.createChatPropertiesStore.createChatStickerPackId = packId;

View File

@ -12,12 +12,14 @@ import StatusQ.Popups.Dialog 0.1
import utils 1.0 import utils 1.0
import shared.views.chat 1.0 import shared.views.chat 1.0
import shared.stores 1.0 as SharedStores
import AppLayouts.Chat.stores 1.0 as ChatStores import AppLayouts.Chat.stores 1.0 as ChatStores
StatusDialog { StatusDialog {
id: root id: root
property SharedStores.RootStore sharedRootStore
property ChatStores.RootStore rootStore property ChatStores.RootStore rootStore
property var chatCommunitySectionModule property var chatCommunitySectionModule
property var memberMessagesModel: chatCommunitySectionModule.memberMessagesModel property var memberMessagesModel: chatCommunitySectionModule.memberMessagesModel
@ -62,6 +64,7 @@ StatusDialog {
width: parent.width width: parent.width
sharedRootStore: root.sharedRootStore
rootStore: root.store rootStore: root.store
chatCommunitySectionModule: root.chatCommunitySectionModule chatCommunitySectionModule: root.chatCommunitySectionModule
messageStore: root.memberMessagesModel messageStore: root.memberMessagesModel

View File

@ -35,6 +35,7 @@ StatusSectionLayout {
objectName: "profileStatusSectionLayout" objectName: "profileStatusSectionLayout"
property SharedStores.RootStore sharedRootStore
property ProfileSectionStore store property ProfileSectionStore store
property AppLayoutsStores.RootStore globalStore property AppLayoutsStores.RootStore globalStore
property var systemPalette property var systemPalette
@ -188,7 +189,7 @@ StatusSectionLayout {
implicitWidth: parent.width implicitWidth: parent.width
implicitHeight: parent.height implicitHeight: parent.height
privacyStore: root.store.privacyStore privacyStore: root.store.privacyStore
passwordStrengthScoreFunction: SharedStores.RootStore.getPasswordStrengthScore passwordStrengthScoreFunction: root.sharedRootStore.getPasswordStrengthScore
contentWidth: d.contentWidth contentWidth: d.contentWidth
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.password) sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.password)
} }
@ -247,6 +248,7 @@ StatusSectionLayout {
implicitWidth: parent.width implicitWidth: parent.width
implicitHeight: parent.height implicitHeight: parent.height
myPublicKey: root.store.contactsStore.myPublicKey myPublicKey: root.store.contactsStore.myPublicKey
currencySymbol: root.sharedRootStore.currencyStore.currentCurrency
rootStore: root.store rootStore: root.store
tokensStore: root.tokensStore tokensStore: root.tokensStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore

View File

@ -32,6 +32,8 @@ SettingsContentBase {
property var emojiPopup property var emojiPopup
property string myPublicKey: "" property string myPublicKey: ""
property alias currencySymbol: manageTokensView.currencySymbol
property ProfileSectionStore rootStore property ProfileSectionStore rootStore
property WalletStore walletStore: rootStore.walletStore property WalletStore walletStore: rootStore.walletStore
required property TokensStore tokensStore required property TokensStore tokensStore

View File

@ -34,6 +34,7 @@ Item {
required property var baseWalletAssetsModel required property var baseWalletAssetsModel
required property var baseWalletCollectiblesModel required property var baseWalletCollectiblesModel
property string currencySymbol: "USD"
property var getCurrencyAmount: function (balance, symbol) {} property var getCurrencyAmount: function (balance, symbol) {}
property var getCurrentCurrencyAmount: function(balance){} property var getCurrentCurrencyAmount: function(balance){}
@ -216,7 +217,7 @@ Item {
CurrencyAmountInput { CurrencyAmountInput {
id: currencyAmount id: currencyAmount
enabled: displayThresholdSwitch.checked enabled: displayThresholdSwitch.checked
currencySymbol: SharedStores.RootStore.currencyStore.currentCurrency currencySymbol: root.currencySymbol
value: advancedSettings.getDisplayThresholdAmount() value: advancedSettings.getDisplayThresholdAmount()
onValueChanged: { onValueChanged: {
if (!advancedSettings.dirty && advancedSettings.getDisplayThresholdAmount() === value) { if (!advancedSettings.dirty && advancedSettings.getDisplayThresholdAmount() === value) {

View File

@ -10,7 +10,7 @@ import utils 1.0
import shared.controls 1.0 import shared.controls 1.0
import shared.popups.keypairimport 1.0 import shared.popups.keypairimport 1.0
import shared.stores 1.0 import shared.stores 1.0 as SharedStores
import shared.stores.send 1.0 import shared.stores.send 1.0
import AppLayouts.stores 1.0 as AppLayoutsStores import AppLayouts.stores 1.0 as AppLayoutsStores
@ -30,6 +30,7 @@ Item {
property bool hideSignPhraseModal: false property bool hideSignPhraseModal: false
property SharedStores.RootStore sharedRootStore
property AppLayoutsStores.RootStore store property AppLayoutsStores.RootStore store
property ProfileStores.ContactsStore contactsStore property ProfileStores.ContactsStore contactsStore
property CommunitiesStore communitiesStore property CommunitiesStore communitiesStore
@ -37,7 +38,7 @@ Item {
property var emojiPopup: null property var emojiPopup: null
property var sendModalPopup property var sendModalPopup
property NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
property bool appMainVisible property bool appMainVisible
property bool dappsEnabled property bool dappsEnabled
@ -220,6 +221,7 @@ Item {
Component { Component {
id: walletContainer id: walletContainer
RightTabView { RightTabView {
sharedRootStore: root.sharedRootStore
store: root.store store: root.store
contactsStore: root.contactsStore contactsStore: root.contactsStore
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore

View File

@ -1,7 +1,7 @@
import QtQuick 2.13 import QtQuick 2.15
import QtQuick.Layouts 1.13 import QtQuick.Layouts 1.15
import QtQuick.Controls 2.14 import QtQuick.Controls 2.15
import QtQuick.Window 2.12 import QtQuick.Window 2.15
import StatusQ 0.1 import StatusQ 0.1
import StatusQ.Components 0.1 import StatusQ.Components 0.1
@ -13,7 +13,7 @@ import StatusQ.Controls 0.1
import utils 1.0 import utils 1.0
import shared.views 1.0 import shared.views 1.0
import shared.controls 1.0 import shared.controls 1.0
import shared.stores 1.0 import shared.stores 1.0 as SharedStores
import AppLayouts.Wallet.stores 1.0 as WalletStores import AppLayouts.Wallet.stores 1.0 as WalletStores
@ -28,18 +28,19 @@ Item {
id: root id: root
property var token: ({}) property var token: ({})
property SharedStores.RootStore sharedRootStore
property WalletStores.TokensStore tokensStore property WalletStores.TokensStore tokensStore
property CurrenciesStore currencyStore property SharedStores.CurrenciesStore currencyStore
property NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
property var allNetworksModel property var allNetworksModel
property var networkFilters property var networkFilters
onNetworkFiltersChanged: d.forceRefreshBalanceStore = true onNetworkFiltersChanged: d.forceRefreshBalanceStore = true
/*required*/ property string address: "" /*required*/ property string address: ""
property TokenBalanceHistoryStore balanceStore: TokenBalanceHistoryStore {} property SharedStores.TokenBalanceHistoryStore balanceStore: SharedStores.TokenBalanceHistoryStore {}
QtObject { QtObject {
id: d id: d
property TokenMarketValuesStore marketValueStore : RootStore.marketValueStore property SharedStores.TokenMarketValuesStore marketValueStore : root.sharedRootStore.marketValueStore
readonly property string symbol: !!root.token? root.token.symbol?? "" : "" readonly property string symbol: !!root.token? root.token.symbol?? "" : ""
property bool marketDetailsLoading: !!root.token? root.token.marketDetailsLoading?? false : false property bool marketDetailsLoading: !!root.token? root.token.marketDetailsLoading?? false : false
property bool tokenDetailsLoading: !!root.token? root.token.detailsLoading?? false: false property bool tokenDetailsLoading: !!root.token? root.token.detailsLoading?? false: false
@ -136,7 +137,7 @@ Item {
id: graphDetail id: graphDetail
property int selectedGraphType: AssetsDetailView.GraphType.Price property int selectedGraphType: AssetsDetailView.GraphType.Price
property TokenMarketValuesStore selectedStore: d.marketValueStore property SharedStores.TokenMarketValuesStore selectedStore: d.marketValueStore
function dataReady() { function dataReady() {
return typeof selectedStore != "undefined" return typeof selectedStore != "undefined"
@ -165,7 +166,7 @@ Item {
{text: qsTr("Price"), enabled: true, id: AssetsDetailView.GraphType.Price, visible: !d.isCommunityAsset}, {text: qsTr("Price"), enabled: true, id: AssetsDetailView.GraphType.Price, visible: !d.isCommunityAsset},
{text: qsTr("Balance"), enabled: true, id: AssetsDetailView.GraphType.Balance, visible: true}, {text: qsTr("Balance"), enabled: true, id: AssetsDetailView.GraphType.Balance, visible: true},
] ]
defaultTimeRangeIndexShown: ChartStoreBase.TimeRange.All defaultTimeRangeIndexShown: SharedStores.ChartStoreBase.TimeRange.All
timeRangeModel: dataReady() && selectedStore.timeRangeTabsModel timeRangeModel: dataReady() && selectedStore.timeRangeTabsModel
onHeaderTabClicked: (privateIdentifier, isTimeRange) => { onHeaderTabClicked: (privateIdentifier, isTimeRange) => {
if(!isTimeRange && graphDetail.selectedGraphType !== privateIdentifier) { if(!isTimeRange && graphDetail.selectedGraphType !== privateIdentifier) {
@ -185,7 +186,7 @@ Item {
readonly property var dateToShortLabel: function (value) { readonly property var dateToShortLabel: function (value) {
const range = balanceStore.timeRangeStrToEnum(graphDetail.selectedTimeRange) const range = balanceStore.timeRangeStrToEnum(graphDetail.selectedTimeRange)
return range === ChartStoreBase.TimeRange.Weekly || range === ChartStoreBase.TimeRange.Monthly ? return range === SharedStores.ChartStoreBase.TimeRange.Weekly || range === SharedStores.ChartStoreBase.TimeRange.Monthly ?
LocaleUtils.getDayMonth(value) : LocaleUtils.getDayMonth(value) :
LocaleUtils.getMonthYear(value) LocaleUtils.getMonthYear(value)
} }
@ -319,7 +320,7 @@ Item {
function updateBalanceStore() { function updateBalanceStore() {
let selectedTimeRangeEnum = balanceStore.timeRangeStrToEnum(graphDetail.selectedTimeRange) let selectedTimeRangeEnum = balanceStore.timeRangeStrToEnum(graphDetail.selectedTimeRange)
let currencySymbol = RootStore.currencyStore.currentCurrency let currencySymbol = root.sharedRootStore.currencyStore.currentCurrency
if(!balanceStore.hasData(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum) || d.forceRefreshBalanceStore) { if(!balanceStore.hasData(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum) || d.forceRefreshBalanceStore) {
root.tokensStore.fetchHistoricalBalanceForTokenAsJson(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum) root.tokensStore.fetchHistoricalBalanceForTokenAsJson(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum)
} }

View File

@ -24,6 +24,8 @@ import "../views/collectibles"
RightTabBaseView { RightTabBaseView {
id: root id: root
property SharedStores.RootStore sharedRootStore
property alias currentTabIndex: walletTabBar.currentIndex property alias currentTabIndex: walletTabBar.currentIndex
signal launchShareAddressModal() signal launchShareAddressModal()
@ -445,7 +447,7 @@ RightTabBaseView {
isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading
activityModel: d.detailedCollectibleActivityController.model activityModel: d.detailedCollectibleActivityController.model
addressFilters: RootStore.addressFilters addressFilters: RootStore.addressFilters
rootStore: SharedStores.RootStore rootStore: root.sharedRootStore
walletRootStore: RootStore walletRootStore: RootStore
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore
@ -469,6 +471,7 @@ RightTabBaseView {
visible: (stack.currentIndex === 2) visible: (stack.currentIndex === 2)
sharedRootStore: root.sharedRootStore
tokensStore: RootStore.tokensStore tokensStore: RootStore.tokensStore
allNetworksModel: RootStore.filteredFlatModel allNetworksModel: RootStore.filteredFlatModel
address: RootStore.overview.mixedcaseAddress address: RootStore.overview.mixedcaseAddress
@ -503,8 +506,8 @@ RightTabBaseView {
showAllAccounts: RootStore.showAllAccounts showAllAccounts: RootStore.showAllAccounts
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore
sendModal: root.sendModal sendModal: root.sendModal
rootStore: SharedStores.RootStore rootStore: root.sharedRootStore
currenciesStore: SharedStores.RootStore.currencyStore currenciesStore: root.sharedRootStore.currencyStore
contactsStore: root.contactsStore contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
visible: (stack.currentIndex === 3) visible: (stack.currentIndex === 3)

View File

@ -408,6 +408,8 @@ Item {
Popups { Popups {
id: popups id: popups
sharedRootStore: RootStore
popupParent: appMain popupParent: appMain
rootStore: appMain.rootStore rootStore: appMain.rootStore
communityTokensStore: appMain.communityTokensStore communityTokensStore: appMain.communityTokensStore
@ -1350,6 +1352,7 @@ Item {
restoreMode: Binding.RestoreBindingOrValue restoreMode: Binding.RestoreBindingOrValue
} }
sharedRootStore: RootStore
rootStore: ChatStores.RootStore { rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore communityTokensStore: appMain.communityTokensStore
@ -1397,6 +1400,7 @@ Item {
asynchronous: true asynchronous: true
sourceComponent: WalletLayout { sourceComponent: WalletLayout {
objectName: "walletLayoutReal" objectName: "walletLayoutReal"
sharedRootStore: RootStore
store: appMain.rootStore store: appMain.rootStore
contactsStore: appMain.rootStore.profileSectionStore.contactsStore contactsStore: appMain.rootStore.profileSectionStore.contactsStore
communitiesStore: appMain.communitiesStore communitiesStore: appMain.communitiesStore
@ -1417,6 +1421,7 @@ Item {
active: appView.currentIndex === Constants.appViewStackIndex.profile active: appView.currentIndex === Constants.appViewStackIndex.profile
asynchronous: true asynchronous: true
sourceComponent: ProfileLayout { sourceComponent: ProfileLayout {
sharedRootStore: RootStore
store: appMain.rootStore.profileSectionStore store: appMain.rootStore.profileSectionStore
globalStore: appMain.rootStore globalStore: appMain.rootStore
systemPalette: appMain.sysPalette systemPalette: appMain.sysPalette
@ -1506,6 +1511,7 @@ Item {
communitiesStore: appMain.communitiesStore communitiesStore: appMain.communitiesStore
communitySettingsDisabled: !chatLayoutComponent.isManageCommunityEnabledInAdvanced && communitySettingsDisabled: !chatLayoutComponent.isManageCommunityEnabledInAdvanced &&
(production && appMain.rootStore.profileSectionStore.walletStore.areTestNetworksEnabled) (production && appMain.rootStore.profileSectionStore.walletStore.areTestNetworksEnabled)
sharedRootStore: RootStore
rootStore: ChatStores.RootStore { rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore communityTokensStore: appMain.communityTokensStore
@ -1550,6 +1556,7 @@ Item {
anchors.rightMargin - anchors.leftMargin : 0 anchors.rightMargin - anchors.leftMargin : 0
sourceComponent: CreateChatView { sourceComponent: CreateChatView {
sharedRootStore: RootStore
rootStore: ChatStores.RootStore { rootStore: ChatStores.RootStore {
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
communityTokensStore: appMain.communityTokensStore communityTokensStore: appMain.communityTokensStore

View File

@ -37,6 +37,8 @@ QtObject {
id: root id: root
required property var popupParent required property var popupParent
required property RootStore sharedRootStore
required property AppLayoutStores.RootStore rootStore required property AppLayoutStores.RootStore rootStore
required property CommunityTokensStore communityTokensStore required property CommunityTokensStore communityTokensStore
property CommunitiesStore communitiesStore property CommunitiesStore communitiesStore
@ -641,6 +643,7 @@ QtObject {
Component { Component {
id: pinnedMessagesPopup id: pinnedMessagesPopup
PinnedMessagesPopup { PinnedMessagesPopup {
sharedStore: root.sharedRootStore
onClosed: destroy() onClosed: destroy()
} }
}, },
@ -1230,6 +1233,7 @@ QtObject {
Component { Component {
id: communityMemberMessagesPopup id: communityMemberMessagesPopup
CommunityMemberMessagesPopup { CommunityMemberMessagesPopup {
sharedRootStore: root.sharedRootStore
onClosed: destroy() onClosed: destroy()
} }
}, },

View File

@ -1,5 +1,4 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQml 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
@ -11,10 +10,8 @@ import StatusQ.Core.Theme 0.1
import StatusQ.Popups.Dialog 0.1 import StatusQ.Popups.Dialog 0.1
import AppLayouts.Wallet.controls 1.0 import AppLayouts.Wallet.controls 1.0
import AppLayouts.Wallet.stores 1.0 as WalletStores
import shared.controls 1.0 import shared.controls 1.0
import shared.popups 1.0 import shared.popups 1.0
import shared.stores 1.0
import utils 1.0 import utils 1.0
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2

View File

@ -23,6 +23,7 @@ import AppLayouts.Profile.stores 1.0 as ProfileStores
Loader { Loader {
id: root id: root
property SharedStores.RootStore sharedRootStore
property ChatStores.RootStore rootStore property ChatStores.RootStore rootStore
property ChatStores.MessageStore messageStore property ChatStores.MessageStore messageStore
property ChatStores.UsersStore usersStore property ChatStores.UsersStore usersStore
@ -930,7 +931,7 @@ Loader {
store: root.rootStore store: root.rootStore
usersModel: root.usersStore.usersModel usersModel: root.usersStore.usersModel
sharedStore: SharedStores.RootStore sharedStore: root.sharedRootStore
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
stickersPopup: root.stickersPopup stickersPopup: root.stickersPopup
@ -961,9 +962,9 @@ Loader {
Global.openMenu(imageContextMenuComponent, item, { url: url, domain: domain, requireConfirmationOnOpen: true }) Global.openMenu(imageContextMenuComponent, item, { url: url, domain: domain, requireConfirmationOnOpen: true })
} }
onHoveredLinkChanged: delegate.highlightedLink = linksMessageView.hoveredLink onHoveredLinkChanged: delegate.highlightedLink = linksMessageView.hoveredLink
gifUnfurlingEnabled: SharedStores.RootStore.gifUnfurlingEnabled gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled
canAskToUnfurlGifs: !SharedStores.RootStore.neverAskAboutUnfurlingAgain canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain
onSetNeverAskAboutUnfurlingAgain: SharedStores.RootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain) onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain)
Component.onCompleted: { Component.onCompleted: {
root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId) root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId)