mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-12 23:35:32 +00:00
chore: hide create community button behind advanced setting
Fixes #14530 (includes a revert of the previous hide that wasn't exactly what we wanted)
This commit is contained in:
parent
2972531766
commit
bfb506540f
@ -17,11 +17,13 @@ const LAS_KEY_CUSTOM_MOUSE_SCROLLING_ENABLED = "global/custom_mouse_scroll_enabl
|
|||||||
const DEFAULT_CUSTOM_MOUSE_SCROLLING_ENABLED = false
|
const DEFAULT_CUSTOM_MOUSE_SCROLLING_ENABLED = false
|
||||||
const DEFAULT_VISIBILITY = 2 #windowed visibility, from qml
|
const DEFAULT_VISIBILITY = 2 #windowed visibility, from qml
|
||||||
const LAS_KEY_FAKE_LOADING_SCREEN_ENABLED = "global/fake_loading_screen"
|
const LAS_KEY_FAKE_LOADING_SCREEN_ENABLED = "global/fake_loading_screen"
|
||||||
|
const LAS_KEY_CREATE_COMMUNITIES_ENABLED = "global/create_communities"
|
||||||
let DEFAULT_FAKE_LOADING_SCREEN_ENABLED = defined(production) and not TEST_MODE_ENABLED #enabled in production, disabled in development and e2e tests
|
let DEFAULT_FAKE_LOADING_SCREEN_ENABLED = defined(production) and not TEST_MODE_ENABLED #enabled in production, disabled in development and e2e tests
|
||||||
const LAS_KEY_SHARDED_COMMUNITIES_ENABLED = "global/sharded_communities"
|
const LAS_KEY_SHARDED_COMMUNITIES_ENABLED = "global/sharded_communities"
|
||||||
const DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED = false
|
const DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED = false
|
||||||
const LAS_KEY_TRANSLATIONS_ENABLED = "global/translations_enabled"
|
const LAS_KEY_TRANSLATIONS_ENABLED = "global/translations_enabled"
|
||||||
const DEFAULT_LAS_KEY_TRANSLATIONS_ENABLED = false
|
const DEFAULT_LAS_KEY_TRANSLATIONS_ENABLED = false
|
||||||
|
const DEFAULT_LAS_KEY_CREATE_COMMUNITIES_ENABLED = false
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
type LocalAppSettings* = ref object of QObject
|
type LocalAppSettings* = ref object of QObject
|
||||||
@ -148,6 +150,19 @@ QtObject:
|
|||||||
write = setFakeLoadingScreenEnabled
|
write = setFakeLoadingScreenEnabled
|
||||||
notify = fakeLoadingScreenEnabledChanged
|
notify = fakeLoadingScreenEnabledChanged
|
||||||
|
|
||||||
|
proc createCommunityEnabledChanged*(self: LocalAppSettings) {.signal.}
|
||||||
|
proc getCreateCommunityEnabled*(self: LocalAppSettings): bool {.slot.} =
|
||||||
|
self.settings.value(LAS_KEY_CREATE_COMMUNITIES_ENABLED, newQVariant(DEFAULT_LAS_KEY_CREATE_COMMUNITIES_ENABLED)).boolVal
|
||||||
|
|
||||||
|
proc setCreateCommunityEnabled*(self: LocalAppSettings, enabled: bool) {.slot.} =
|
||||||
|
self.settings.setValue(LAS_KEY_CREATE_COMMUNITIES_ENABLED, newQVariant(enabled))
|
||||||
|
self.createCommunityEnabledChanged()
|
||||||
|
|
||||||
|
QtProperty[bool] createCommunityEnabled:
|
||||||
|
read = getCreateCommunityEnabled
|
||||||
|
write = setCreateCommunityEnabled
|
||||||
|
notify = createCommunityEnabledChanged
|
||||||
|
|
||||||
proc wakuV2ShardedCommunitiesEnabledChanged*(self: LocalAppSettings) {.signal.}
|
proc wakuV2ShardedCommunitiesEnabledChanged*(self: LocalAppSettings) {.signal.}
|
||||||
proc getWakuV2ShardedCommunitiesEnabled*(self: LocalAppSettings): bool {.slot.} =
|
proc getWakuV2ShardedCommunitiesEnabled*(self: LocalAppSettings): bool {.slot.} =
|
||||||
self.settings.value(LAS_KEY_SHARDED_COMMUNITIES_ENABLED, newQVariant(DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED)).boolVal
|
self.settings.value(LAS_KEY_SHARDED_COMMUNITIES_ENABLED, newQVariant(DEFAULT_LAS_KEY_SHARDED_COMMUNITIES_ENABLED)).boolVal
|
||||||
|
@ -137,10 +137,13 @@ StatusSectionLayout {
|
|||||||
onClicked: Global.importCommunityPopupRequested()
|
onClicked: Global.importCommunityPopupRequested()
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusButton {
|
Loader {
|
||||||
|
Layout.preferredHeight: active ? 38 : 0
|
||||||
|
active: communitiesStore.createCommunityEnabled || communitiesStore.testEnvironment
|
||||||
|
sourceComponent: StatusButton {
|
||||||
id: createBtn
|
id: createBtn
|
||||||
objectName: "createCommunityButton"
|
objectName: "createCommunityButton"
|
||||||
Layout.preferredHeight: 38
|
height: parent.height
|
||||||
verticalPadding: 0
|
verticalPadding: 0
|
||||||
text: qsTr("Create community")
|
text: qsTr("Create community")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@ -148,6 +151,7 @@ StatusSectionLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TagsRow {
|
TagsRow {
|
||||||
id: communityTags
|
id: communityTags
|
||||||
|
@ -35,6 +35,9 @@ QtObject {
|
|||||||
property bool downloadingCommunityHistoryArchives: root.communitiesModuleInst.downloadingCommunityHistoryArchives
|
property bool downloadingCommunityHistoryArchives: root.communitiesModuleInst.downloadingCommunityHistoryArchives
|
||||||
property var advancedModule: profileSectionModule.advancedModule
|
property var advancedModule: profileSectionModule.advancedModule
|
||||||
|
|
||||||
|
readonly property bool createCommunityEnabled: localAppSettings.createCommunityEnabled ?? false
|
||||||
|
readonly property bool testEnvironment: localAppSettings.testEnvironment ?? false
|
||||||
|
|
||||||
// TODO: Could the backend provide directly 2 filtered models??
|
// TODO: Could the backend provide directly 2 filtered models??
|
||||||
//property var featuredCommunitiesModel: root.communitiesModuleInst.curatedFeaturedCommunities
|
//property var featuredCommunitiesModel: root.communitiesModuleInst.curatedFeaturedCommunities
|
||||||
//property var popularCommunitiesModel: root.communitiesModuleInst.curatedPopularCommunities
|
//property var popularCommunitiesModel: root.communitiesModuleInst.curatedPopularCommunities
|
||||||
|
@ -22,6 +22,7 @@ QtObject {
|
|||||||
property var customNetworksModel: advancedModule? advancedModule.customNetworksModel : []
|
property var customNetworksModel: advancedModule? advancedModule.customNetworksModel : []
|
||||||
|
|
||||||
readonly property bool isFakeLoadingScreenEnabled: localAppSettings.fakeLoadingScreenEnabled ?? false
|
readonly property bool isFakeLoadingScreenEnabled: localAppSettings.fakeLoadingScreenEnabled ?? false
|
||||||
|
readonly property bool createCommunityEnabled: localAppSettings.createCommunityEnabled ?? false
|
||||||
property bool isManageCommunityOnTestModeEnabled: false
|
property bool isManageCommunityOnTestModeEnabled: false
|
||||||
readonly property QtObject experimentalFeatures: QtObject {
|
readonly property QtObject experimentalFeatures: QtObject {
|
||||||
readonly property string browser: "browser"
|
readonly property string browser: "browser"
|
||||||
@ -142,6 +143,13 @@ QtObject {
|
|||||||
localAppSettings.fakeLoadingScreenEnabled = !localAppSettings.fakeLoadingScreenEnabled
|
localAppSettings.fakeLoadingScreenEnabled = !localAppSettings.fakeLoadingScreenEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleCreateCommunityEnabled() {
|
||||||
|
if(!localAppSettings)
|
||||||
|
return
|
||||||
|
|
||||||
|
localAppSettings.createCommunityEnabled = !localAppSettings.createCommunityEnabled
|
||||||
|
}
|
||||||
|
|
||||||
function toggleManageCommunityOnTestnet() {
|
function toggleManageCommunityOnTestnet() {
|
||||||
root.isManageCommunityOnTestModeEnabled = !root.isManageCommunityOnTestModeEnabled
|
root.isManageCommunityOnTestModeEnabled = !root.isManageCommunityOnTestModeEnabled
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,17 @@ SettingsContentBase {
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
// WalletConnect POC - to remove
|
// WalletConnect POC - to remove
|
||||||
|
StatusSettingsLineButton {
|
||||||
|
anchors.leftMargin: 0
|
||||||
|
anchors.rightMargin: 0
|
||||||
|
text: qsTr("Enable Community Creation")
|
||||||
|
isSwitch: true
|
||||||
|
switchChecked: root.advancedStore.createCommunityEnabled
|
||||||
|
onClicked: {
|
||||||
|
root.advancedStore.toggleCreateCommunityEnabled()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StatusSettingsLineButton {
|
StatusSettingsLineButton {
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
anchors.rightMargin: 0
|
anchors.rightMargin: 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user