From 2af0d6668bd69d5a5d17ca3b5168786927b0acd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Wed, 2 Oct 2024 22:47:14 +0200 Subject: [PATCH] stores: access shared/RootStore via explicit property instead of singleton --- ui/app/AppLayouts/Chat/ChatLayout.qml | 22 ++++++++------- .../Chat/popups/PinnedMessagesPopup.qml | 3 +++ .../AppLayouts/Chat/views/ChatColumnView.qml | 4 ++- .../AppLayouts/Chat/views/ChatContentView.qml | 4 +++ .../Chat/views/ChatMessagesView.qml | 5 ++++ ui/app/AppLayouts/Chat/views/ChatView.qml | 18 ++++++++----- .../AppLayouts/Chat/views/CreateChatView.qml | 3 ++- .../popups/CommunityMemberMessagesPopup.qml | 3 +++ ui/app/AppLayouts/Profile/ProfileLayout.qml | 4 ++- .../AppLayouts/Profile/views/WalletView.qml | 2 ++ .../Profile/views/wallet/ManageTokensView.qml | 3 ++- ui/app/AppLayouts/Wallet/WalletLayout.qml | 6 +++-- .../Wallet/views/AssetsDetailView.qml | 27 ++++++++++--------- .../AppLayouts/Wallet/views/RightTabView.qml | 9 ++++--- ui/app/mainui/AppMain.qml | 7 +++++ ui/app/mainui/Popups.qml | 4 +++ ui/imports/shared/views/AssetsView.qml | 3 --- ui/imports/shared/views/chat/MessageView.qml | 9 ++++--- 18 files changed, 90 insertions(+), 46 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatLayout.qml b/ui/app/AppLayouts/Chat/ChatLayout.qml index 936839df67..27378dcf9e 100644 --- a/ui/app/AppLayouts/Chat/ChatLayout.qml +++ b/ui/app/AppLayouts/Chat/ChatLayout.qml @@ -4,8 +4,8 @@ import QtQuick.Layouts 1.14 import utils 1.0 import shared.popups 1.0 -import shared.stores 1.0 -import shared.stores.send 1.0 +import shared.stores 1.0 as SharedStores +import shared.stores.send 1.0 as SendStores import "views" @@ -14,8 +14,8 @@ import AppLayouts.Communities.popups 1.0 import AppLayouts.Communities.helpers 1.0 import AppLayouts.Communities.stores 1.0 as CommunitiesStores -import AppLayouts.Chat.stores 1.0 -import AppLayouts.Profile.stores 1.0 +import AppLayouts.Chat.stores 1.0 as ChatStores +import AppLayouts.Profile.stores 1.0 as ProfileStores import AppLayouts.Wallet.stores 1.0 as WalletStore import StatusQ.Core.Utils 0.1 @@ -23,15 +23,16 @@ import StatusQ.Core.Utils 0.1 StackLayout { id: root - property RootStore rootStore - property CreateChatPropertiesStore createChatPropertiesStore - readonly property ContactsStore contactsStore: rootStore.contactsStore - readonly property PermissionsStore permissionsStore: rootStore.permissionsStore + property SharedStores.RootStore sharedRootStore + property ChatStores.RootStore rootStore + property ChatStores.CreateChatPropertiesStore createChatPropertiesStore + readonly property ProfileStores.ContactsStore contactsStore: rootStore.contactsStore + readonly property SharedStores.PermissionsStore permissionsStore: rootStore.permissionsStore property CommunitiesStores.CommunitiesStore communitiesStore required property WalletStore.TokensStore tokensStore - required property TransactionStore transactionStore + required property SendStores.TransactionStore transactionStore required property WalletStore.WalletAssetsStore walletAssetsStore - required property CurrenciesStore currencyStore + required property SharedStores.CurrenciesStore currencyStore property var sectionItemModel property var sendModalPopup @@ -148,6 +149,7 @@ StackLayout { emojiPopup: root.emojiPopup stickersPopup: root.stickersPopup contactsStore: root.contactsStore + sharedRootStore: root.sharedRootStore rootStore: root.rootStore transactionStore: root.transactionStore createChatPropertiesStore: root.createChatPropertiesStore diff --git a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml index c53f4636ab..e6d26f9ea8 100644 --- a/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/PinnedMessagesPopup.qml @@ -12,12 +12,14 @@ import StatusQ.Popups.Dialog 0.1 import utils 1.0 import shared.views.chat 1.0 +import shared.stores 1.0 as SharedStores import AppLayouts.Chat.stores 1.0 StatusDialog { id: root + property SharedStores.RootStore sharedStore property RootStore store 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. @@ -77,6 +79,7 @@ StatusDialog { width: parent.width + sharedRootStore: root.sharedStore rootStore: root.store messageStore: root.messageStore diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index e0f95b31d0..4e44dc3f32 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -39,6 +39,7 @@ Item { // don't follow struct we have on the backend. property var parentModule + property SharedStores.RootStore sharedRootStore property RootStore rootStore property CreateChatPropertiesStore createChatPropertiesStore property ContactsStore contactsStore @@ -234,6 +235,7 @@ Item { chatId: model.itemId chatType: model.type chatMessagesLoader.active: model.loaderActive + sharedRootStore: root.sharedRootStore rootStore: root.rootStore contactsStore: root.contactsStore emojiPopup: root.emojiPopup @@ -290,7 +292,7 @@ Item { store: root.rootStore usersModel: d.activeUsersStore.usersModel - sharedStore: SharedStores.RootStore + sharedStore: root.sharedRootStore linkPreviewModel: !!d.activeChatContentModule ? d.activeChatContentModule.inputAreaModule.linkPreviewModel : null urlsList: d.urlsList diff --git a/ui/app/AppLayouts/Chat/views/ChatContentView.qml b/ui/app/AppLayouts/Chat/views/ChatContentView.qml index d3f6e956c2..7330130c8c 100644 --- a/ui/app/AppLayouts/Chat/views/ChatContentView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatContentView.qml @@ -10,6 +10,7 @@ import StatusQ.Controls 0.1 import utils 1.0 import shared 1.0 +import shared.stores 1.0 as SharedStores import shared.popups 1.0 import shared.status 1.0 import shared.controls 1.0 @@ -30,6 +31,7 @@ ColumnLayout { // Important: each chat/channel has its own ChatContentModule property var chatContentModule property var chatSectionModule + property SharedStores.RootStore sharedRootStore property RootStore rootStore property ContactsStore contactsStore property string chatId @@ -81,6 +83,8 @@ ColumnLayout { sourceComponent: ChatMessagesView { chatContentModule: root.chatContentModule + + sharedRootStore: root.sharedRootStore rootStore: root.rootStore contactsStore: root.contactsStore messageStore: root.messageStore diff --git a/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml b/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml index 29d633734f..8701b9bafc 100644 --- a/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatMessagesView.qml @@ -12,6 +12,7 @@ import StatusQ.Core.Theme 0.1 import utils 1.0 import shared 1.0 +import shared.stores 1.0 as SharedStores import shared.views 1.0 import shared.panels 1.0 import shared.popups 1.0 @@ -29,6 +30,8 @@ Item { id: root property var chatContentModule + + property SharedStores.RootStore sharedRootStore property RootStore rootStore property MessageStore messageStore property UsersStore usersStore @@ -266,6 +269,8 @@ Item { width: ListView.view.width objectName: "chatMessageViewDelegate" + + sharedRootStore: root.sharedRootStore rootStore: root.rootStore messageStore: root.messageStore usersStore: root.usersStore diff --git a/ui/app/AppLayouts/Chat/views/ChatView.qml b/ui/app/AppLayouts/Chat/views/ChatView.qml index 81903a373a..0865bd1dd1 100644 --- a/ui/app/AppLayouts/Chat/views/ChatView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatView.qml @@ -7,9 +7,9 @@ import shared 1.0 import shared.panels 1.0 import shared.popups 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.stores.send 1.0 +import shared.stores.send 1.0 as SendStores import SortFilterProxyModel 0.2 import StatusQ.Core 0.1 @@ -29,10 +29,12 @@ import AppLayouts.Communities.views 1.0 import AppLayouts.Profile.stores 1.0 import AppLayouts.Wallet.stores 1.0 as WalletStore + +import AppLayouts.Chat.stores 1.0 as ChatStores + import "../popups" import "../helpers" import "../controls" -import "../stores" StatusSectionLayout { id: root @@ -40,12 +42,13 @@ StatusSectionLayout { property ContactsStore contactsStore property bool hasAddedContacts: contactsStore.myContactsModel.count > 0 - property RootStore rootStore - required property TransactionStore transactionStore - property CreateChatPropertiesStore createChatPropertiesStore + property SharedStores.RootStore sharedRootStore + property ChatStores.RootStore rootStore + required property SendStores.TransactionStore transactionStore + property ChatStores.CreateChatPropertiesStore createChatPropertiesStore property CommunitiesStores.CommunitiesStore communitiesStore required property WalletStore.WalletAssetsStore walletAssetsStore - required property CurrenciesStore currencyStore + required property SharedStores.CurrenciesStore currencyStore property var sectionItemModel property var emojiPopup @@ -220,6 +223,7 @@ StatusSectionLayout { ChatColumnView { parentModule: root.rootStore.chatCommunitySectionModule + sharedRootStore: root.sharedRootStore rootStore: root.rootStore createChatPropertiesStore: root.createChatPropertiesStore contactsStore: root.contactsStore diff --git a/ui/app/AppLayouts/Chat/views/CreateChatView.qml b/ui/app/AppLayouts/Chat/views/CreateChatView.qml index e6990e0ba2..c03713036f 100644 --- a/ui/app/AppLayouts/Chat/views/CreateChatView.qml +++ b/ui/app/AppLayouts/Chat/views/CreateChatView.qml @@ -19,6 +19,7 @@ import AppLayouts.Chat.stores 1.0 as ChatStores Page { id: root + property SharedStores.RootStore sharedRootStore property ChatStores.RootStore rootStore property ChatStores.CreateChatPropertiesStore createChatPropertiesStore property var emojiPopup: null @@ -162,7 +163,7 @@ Page { stickersPopup: root.stickersPopup closeGifPopupAfterSelection: true usersModel: membersSelector.model - sharedStore: SharedStores.RootStore + sharedStore: root.sharedRootStore onStickerSelected: { root.createChatPropertiesStore.createChatStickerHashId = hashId; root.createChatPropertiesStore.createChatStickerPackId = packId; diff --git a/ui/app/AppLayouts/Communities/popups/CommunityMemberMessagesPopup.qml b/ui/app/AppLayouts/Communities/popups/CommunityMemberMessagesPopup.qml index 637ce720e4..6ce8465d47 100644 --- a/ui/app/AppLayouts/Communities/popups/CommunityMemberMessagesPopup.qml +++ b/ui/app/AppLayouts/Communities/popups/CommunityMemberMessagesPopup.qml @@ -12,12 +12,14 @@ import StatusQ.Popups.Dialog 0.1 import utils 1.0 import shared.views.chat 1.0 +import shared.stores 1.0 as SharedStores import AppLayouts.Chat.stores 1.0 as ChatStores StatusDialog { id: root + property SharedStores.RootStore sharedRootStore property ChatStores.RootStore rootStore property var chatCommunitySectionModule property var memberMessagesModel: chatCommunitySectionModule.memberMessagesModel @@ -62,6 +64,7 @@ StatusDialog { width: parent.width + sharedRootStore: root.sharedRootStore rootStore: root.store chatCommunitySectionModule: root.chatCommunitySectionModule messageStore: root.memberMessagesModel diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index 2a12fa7f53..3b1e103998 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -35,6 +35,7 @@ StatusSectionLayout { objectName: "profileStatusSectionLayout" + property SharedStores.RootStore sharedRootStore property ProfileSectionStore store property AppLayoutsStores.RootStore globalStore property var systemPalette @@ -188,7 +189,7 @@ StatusSectionLayout { implicitWidth: parent.width implicitHeight: parent.height privacyStore: root.store.privacyStore - passwordStrengthScoreFunction: SharedStores.RootStore.getPasswordStrengthScore + passwordStrengthScoreFunction: root.sharedRootStore.getPasswordStrengthScore contentWidth: d.contentWidth sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.password) } @@ -247,6 +248,7 @@ StatusSectionLayout { implicitWidth: parent.width implicitHeight: parent.height myPublicKey: root.store.contactsStore.myPublicKey + currencySymbol: root.sharedRootStore.currencyStore.currentCurrency rootStore: root.store tokensStore: root.tokensStore networkConnectionStore: root.networkConnectionStore diff --git a/ui/app/AppLayouts/Profile/views/WalletView.qml b/ui/app/AppLayouts/Profile/views/WalletView.qml index 5898c2f504..05f9b10d48 100644 --- a/ui/app/AppLayouts/Profile/views/WalletView.qml +++ b/ui/app/AppLayouts/Profile/views/WalletView.qml @@ -32,6 +32,8 @@ SettingsContentBase { property var emojiPopup property string myPublicKey: "" + property alias currencySymbol: manageTokensView.currencySymbol + property ProfileSectionStore rootStore property WalletStore walletStore: rootStore.walletStore required property TokensStore tokensStore diff --git a/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml b/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml index ae0a44f6dd..441dd12b61 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml @@ -34,6 +34,7 @@ Item { required property var baseWalletAssetsModel required property var baseWalletCollectiblesModel + property string currencySymbol: "USD" property var getCurrencyAmount: function (balance, symbol) {} property var getCurrentCurrencyAmount: function(balance){} @@ -216,7 +217,7 @@ Item { CurrencyAmountInput { id: currencyAmount enabled: displayThresholdSwitch.checked - currencySymbol: SharedStores.RootStore.currencyStore.currentCurrency + currencySymbol: root.currencySymbol value: advancedSettings.getDisplayThresholdAmount() onValueChanged: { if (!advancedSettings.dirty && advancedSettings.getDisplayThresholdAmount() === value) { diff --git a/ui/app/AppLayouts/Wallet/WalletLayout.qml b/ui/app/AppLayouts/Wallet/WalletLayout.qml index 3fdab822b6..93396758c2 100644 --- a/ui/app/AppLayouts/Wallet/WalletLayout.qml +++ b/ui/app/AppLayouts/Wallet/WalletLayout.qml @@ -10,7 +10,7 @@ import utils 1.0 import shared.controls 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 AppLayouts.stores 1.0 as AppLayoutsStores @@ -30,6 +30,7 @@ Item { property bool hideSignPhraseModal: false + property SharedStores.RootStore sharedRootStore property AppLayoutsStores.RootStore store property ProfileStores.ContactsStore contactsStore property CommunitiesStore communitiesStore @@ -37,7 +38,7 @@ Item { property var emojiPopup: null property var sendModalPopup - property NetworkConnectionStore networkConnectionStore + property SharedStores.NetworkConnectionStore networkConnectionStore property bool appMainVisible property bool dappsEnabled @@ -220,6 +221,7 @@ Item { Component { id: walletContainer RightTabView { + sharedRootStore: root.sharedRootStore store: root.store contactsStore: root.contactsStore communitiesStore: root.communitiesStore diff --git a/ui/app/AppLayouts/Wallet/views/AssetsDetailView.qml b/ui/app/AppLayouts/Wallet/views/AssetsDetailView.qml index f182ff8f79..860d0279b2 100644 --- a/ui/app/AppLayouts/Wallet/views/AssetsDetailView.qml +++ b/ui/app/AppLayouts/Wallet/views/AssetsDetailView.qml @@ -1,7 +1,7 @@ -import QtQuick 2.13 -import QtQuick.Layouts 1.13 -import QtQuick.Controls 2.14 -import QtQuick.Window 2.12 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import QtQuick.Controls 2.15 +import QtQuick.Window 2.15 import StatusQ 0.1 import StatusQ.Components 0.1 @@ -13,7 +13,7 @@ import StatusQ.Controls 0.1 import utils 1.0 import shared.views 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 @@ -28,18 +28,19 @@ Item { id: root property var token: ({}) + property SharedStores.RootStore sharedRootStore property WalletStores.TokensStore tokensStore - property CurrenciesStore currencyStore - property NetworkConnectionStore networkConnectionStore + property SharedStores.CurrenciesStore currencyStore + property SharedStores.NetworkConnectionStore networkConnectionStore property var allNetworksModel property var networkFilters onNetworkFiltersChanged: d.forceRefreshBalanceStore = true /*required*/ property string address: "" - property TokenBalanceHistoryStore balanceStore: TokenBalanceHistoryStore {} + property SharedStores.TokenBalanceHistoryStore balanceStore: SharedStores.TokenBalanceHistoryStore {} QtObject { id: d - property TokenMarketValuesStore marketValueStore : RootStore.marketValueStore + property SharedStores.TokenMarketValuesStore marketValueStore : root.sharedRootStore.marketValueStore readonly property string symbol: !!root.token? root.token.symbol?? "" : "" property bool marketDetailsLoading: !!root.token? root.token.marketDetailsLoading?? false : false property bool tokenDetailsLoading: !!root.token? root.token.detailsLoading?? false: false @@ -136,7 +137,7 @@ Item { id: graphDetail property int selectedGraphType: AssetsDetailView.GraphType.Price - property TokenMarketValuesStore selectedStore: d.marketValueStore + property SharedStores.TokenMarketValuesStore selectedStore: d.marketValueStore function dataReady() { return typeof selectedStore != "undefined" @@ -165,7 +166,7 @@ Item { {text: qsTr("Price"), enabled: true, id: AssetsDetailView.GraphType.Price, visible: !d.isCommunityAsset}, {text: qsTr("Balance"), enabled: true, id: AssetsDetailView.GraphType.Balance, visible: true}, ] - defaultTimeRangeIndexShown: ChartStoreBase.TimeRange.All + defaultTimeRangeIndexShown: SharedStores.ChartStoreBase.TimeRange.All timeRangeModel: dataReady() && selectedStore.timeRangeTabsModel onHeaderTabClicked: (privateIdentifier, isTimeRange) => { if(!isTimeRange && graphDetail.selectedGraphType !== privateIdentifier) { @@ -185,7 +186,7 @@ Item { readonly property var dateToShortLabel: function (value) { 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.getMonthYear(value) } @@ -319,7 +320,7 @@ Item { function updateBalanceStore() { 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) { root.tokensStore.fetchHistoricalBalanceForTokenAsJson(root.address, token.symbol, currencySymbol, selectedTimeRangeEnum) } diff --git a/ui/app/AppLayouts/Wallet/views/RightTabView.qml b/ui/app/AppLayouts/Wallet/views/RightTabView.qml index a8457d8bf5..46810542aa 100644 --- a/ui/app/AppLayouts/Wallet/views/RightTabView.qml +++ b/ui/app/AppLayouts/Wallet/views/RightTabView.qml @@ -24,6 +24,8 @@ import "../views/collectibles" RightTabBaseView { id: root + property SharedStores.RootStore sharedRootStore + property alias currentTabIndex: walletTabBar.currentIndex signal launchShareAddressModal() @@ -445,7 +447,7 @@ RightTabBaseView { isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading activityModel: d.detailedCollectibleActivityController.model addressFilters: RootStore.addressFilters - rootStore: SharedStores.RootStore + rootStore: root.sharedRootStore walletRootStore: RootStore communitiesStore: root.communitiesStore @@ -469,6 +471,7 @@ RightTabBaseView { visible: (stack.currentIndex === 2) + sharedRootStore: root.sharedRootStore tokensStore: RootStore.tokensStore allNetworksModel: RootStore.filteredFlatModel address: RootStore.overview.mixedcaseAddress @@ -503,8 +506,8 @@ RightTabBaseView { showAllAccounts: RootStore.showAllAccounts communitiesStore: root.communitiesStore sendModal: root.sendModal - rootStore: SharedStores.RootStore - currenciesStore: SharedStores.RootStore.currencyStore + rootStore: root.sharedRootStore + currenciesStore: root.sharedRootStore.currencyStore contactsStore: root.contactsStore networkConnectionStore: root.networkConnectionStore visible: (stack.currentIndex === 3) diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index a3912b3a4f..752020b5f9 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -408,6 +408,8 @@ Item { Popups { id: popups + + sharedRootStore: RootStore popupParent: appMain rootStore: appMain.rootStore communityTokensStore: appMain.communityTokensStore @@ -1350,6 +1352,7 @@ Item { restoreMode: Binding.RestoreBindingOrValue } + sharedRootStore: RootStore rootStore: ChatStores.RootStore { contactsStore: appMain.rootStore.contactStore communityTokensStore: appMain.communityTokensStore @@ -1397,6 +1400,7 @@ Item { asynchronous: true sourceComponent: WalletLayout { objectName: "walletLayoutReal" + sharedRootStore: RootStore store: appMain.rootStore contactsStore: appMain.rootStore.profileSectionStore.contactsStore communitiesStore: appMain.communitiesStore @@ -1417,6 +1421,7 @@ Item { active: appView.currentIndex === Constants.appViewStackIndex.profile asynchronous: true sourceComponent: ProfileLayout { + sharedRootStore: RootStore store: appMain.rootStore.profileSectionStore globalStore: appMain.rootStore systemPalette: appMain.sysPalette @@ -1506,6 +1511,7 @@ Item { communitiesStore: appMain.communitiesStore communitySettingsDisabled: !chatLayoutComponent.isManageCommunityEnabledInAdvanced && (production && appMain.rootStore.profileSectionStore.walletStore.areTestNetworksEnabled) + sharedRootStore: RootStore rootStore: ChatStores.RootStore { contactsStore: appMain.rootStore.contactStore communityTokensStore: appMain.communityTokensStore @@ -1550,6 +1556,7 @@ Item { anchors.rightMargin - anchors.leftMargin : 0 sourceComponent: CreateChatView { + sharedRootStore: RootStore rootStore: ChatStores.RootStore { contactsStore: appMain.rootStore.contactStore communityTokensStore: appMain.communityTokensStore diff --git a/ui/app/mainui/Popups.qml b/ui/app/mainui/Popups.qml index db3b6c37d6..69fea6f3e5 100644 --- a/ui/app/mainui/Popups.qml +++ b/ui/app/mainui/Popups.qml @@ -37,6 +37,8 @@ QtObject { id: root required property var popupParent + + required property RootStore sharedRootStore required property AppLayoutStores.RootStore rootStore required property CommunityTokensStore communityTokensStore property CommunitiesStore communitiesStore @@ -641,6 +643,7 @@ QtObject { Component { id: pinnedMessagesPopup PinnedMessagesPopup { + sharedStore: root.sharedRootStore onClosed: destroy() } }, @@ -1230,6 +1233,7 @@ QtObject { Component { id: communityMemberMessagesPopup CommunityMemberMessagesPopup { + sharedRootStore: root.sharedRootStore onClosed: destroy() } }, diff --git a/ui/imports/shared/views/AssetsView.qml b/ui/imports/shared/views/AssetsView.qml index e7bdd986d2..bdf9e554ac 100644 --- a/ui/imports/shared/views/AssetsView.qml +++ b/ui/imports/shared/views/AssetsView.qml @@ -1,5 +1,4 @@ import QtQuick 2.15 -import QtQml 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 @@ -11,10 +10,8 @@ import StatusQ.Core.Theme 0.1 import StatusQ.Popups.Dialog 0.1 import AppLayouts.Wallet.controls 1.0 -import AppLayouts.Wallet.stores 1.0 as WalletStores import shared.controls 1.0 import shared.popups 1.0 -import shared.stores 1.0 import utils 1.0 import SortFilterProxyModel 0.2 diff --git a/ui/imports/shared/views/chat/MessageView.qml b/ui/imports/shared/views/chat/MessageView.qml index 37dd8fee91..451aca3875 100644 --- a/ui/imports/shared/views/chat/MessageView.qml +++ b/ui/imports/shared/views/chat/MessageView.qml @@ -23,6 +23,7 @@ import AppLayouts.Profile.stores 1.0 as ProfileStores Loader { id: root + property SharedStores.RootStore sharedRootStore property ChatStores.RootStore rootStore property ChatStores.MessageStore messageStore property ChatStores.UsersStore usersStore @@ -930,7 +931,7 @@ Loader { store: root.rootStore usersModel: root.usersStore.usersModel - sharedStore: SharedStores.RootStore + sharedStore: root.sharedRootStore emojiPopup: root.emojiPopup stickersPopup: root.stickersPopup @@ -961,9 +962,9 @@ Loader { Global.openMenu(imageContextMenuComponent, item, { url: url, domain: domain, requireConfirmationOnOpen: true }) } onHoveredLinkChanged: delegate.highlightedLink = linksMessageView.hoveredLink - gifUnfurlingEnabled: SharedStores.RootStore.gifUnfurlingEnabled - canAskToUnfurlGifs: !SharedStores.RootStore.neverAskAboutUnfurlingAgain - onSetNeverAskAboutUnfurlingAgain: SharedStores.RootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain) + gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled + canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain + onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain) Component.onCompleted: { root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId)