Skip to content

Commit fea6074

Browse files
committed
AccountSettingsStore introduced
New store added intended to encapsulate access to localAccountSensitiveSettings ctx property.
1 parent c090b6b commit fea6074

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import QtQml
2+
3+
import StatusQ.Core.Utils
4+
5+
QObject {
6+
id: root
7+
8+
readonly property bool showUsersList: d.settings.expandUsersList
9+
10+
function setShowUsersList(expanded: bool) {
11+
d.settings.expandUsersList = expanded
12+
}
13+
14+
QtObject {
15+
id: d
16+
17+
readonly property var settings: localAccountSensitiveSettings
18+
}
19+
}

ui/app/AppLayouts/stores/RootStore.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ QtObject {
4141
readonly property ProfileStores.ProfileSectionStore profileSectionStore: ProfileStores.ProfileSectionStore {
4242
localBackupEnabled: root.localBackupEnabled
4343
}
44+
45+
readonly property AccountSettingsStore accountSettingsStore: AccountSettingsStore {}
4446
readonly property ContactsStore contactsStore: ContactsStore {}
4547
readonly property ActivityCenterStore activityCenterStore: ActivityCenterStore {}
4648

ui/app/AppLayouts/stores/qmldir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
AccountSettingsStore 1.0 AccountSettingsStore.qml
12
ActivityCenterStore 1.0 ActivityCenterStore.qml
23
AppSearchStore 1.0 AppSearchStore.qml
34
ContactsStore 1.0 ContactsStore.qml

ui/app/mainui/AppMain.qml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Item {
7272
}
7373

7474
// Global cross-domain stores (just references from `rootStore`)
75+
readonly property AppStores.AccountSettingsStore accountSettingsStore: rootStore.accountSettingsStore
7576
readonly property AppStores.ContactsStore contactsStore: rootStore.contactsStore
7677
readonly property AppStores.ActivityCenterStore activityCenterStore: rootStore.activityCenterStore
7778

@@ -823,10 +824,6 @@ Item {
823824

824825
readonly property int activeSectionType: appMain.rootStore.activeSectionType
825826
readonly property bool isBrowserEnabled: featureFlagsStore.browserEnabled && localAccountSensitiveSettings.isBrowserEnabled
826-
827-
property bool showUsersList: localAccountSensitiveSettings.expandUsersList
828-
829-
onShowUsersListChanged: localAccountSensitiveSettings.expandUsersList = showUsersList
830827

831828
function openHomePage() {
832829
appMain.rootStore.setActiveSectionBySectionType(Constants.appSection.homePage)
@@ -1898,8 +1895,9 @@ Item {
18981895
ChatLayout {
18991896
id: chatLayoutContainer
19001897

1901-
showUsersList: d.showUsersList
1902-
onShowUsersListRequested: show => d.showUsersList = show
1898+
showUsersList: appMain.accountSettingsStore.showUsersList
1899+
onShowUsersListRequested:
1900+
show => appMain.accountSettingsStore.setShowUsersList(show)
19031901

19041902
isChatView: true
19051903
navBar: appMain.navBar
@@ -2291,8 +2289,9 @@ Item {
22912289
}
22922290
}
22932291

2294-
showUsersList: d.showUsersList
2295-
onShowUsersListRequested: show => d.showUsersList = show
2292+
showUsersList: appMain.accountSettingsStore.showUsersList
2293+
onShowUsersListRequested:
2294+
show => appMain.accountSettingsStore.setShowUsersList(show)
22962295

22972296
isChatView: false // This will be a community view
22982297
navBar: appMain.navBar

0 commit comments

Comments
 (0)