Fix community toggle

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2021-06-01 10:20:06 +02:00
parent a3cb837266
commit 508060f18d
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
4 changed files with 93 additions and 83 deletions

View File

@ -41,7 +41,11 @@
(defn get-item [k cb]
(-> ^js async-storage
(.getItem (key->string k))
(.then cb)
(.then (fn [^js data]
(-> data
js->clj
transit->clj
cb)))
(.catch (fn [error]
(cb nil)
(log/error "[async-storage]" error)))))

View File

@ -337,6 +337,7 @@
(transport/start-messenger)
(chat.loading/initialize-chats)
(communities/fetch)
(initialize-communities-enabled)
(multiaccounts/switch-preview-privacy-mode-flag)
(link-preview/request-link-preview-whitelist)
(logging/set-log-level (:log-level multiaccount)))))

View File

@ -2,6 +2,7 @@
(:require [re-frame.core :as re-frame]
[status-im.i18n.i18n :as i18n]
[quo.core :as quo]
[status-im.utils.config :as config]
[status-im.utils.platform :as platform]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
@ -14,85 +15,89 @@
communities-enabled?
current-fleet
webview-debug]}]
[{:size :small
:title (i18n/label :t/network)
:accessibility-label :network-button
:container-margin-top 8
:on-press
#(re-frame/dispatch [:navigate-to :network-settings])
:accessory :text
:accessory-text network-name
:chevron true}
{:size :small
:title (i18n/label :t/network-info)
:accessibility-label :network-button
:container-margin-top 8
:on-press
#(re-frame/dispatch [:navigate-to :network-info])
:chevron true}
{:size :small
:title (i18n/label :t/log-level)
:accessibility-label :log-level-settings-button
:on-press
#(re-frame/dispatch [:navigate-to :log-level-settings])
:accessory :text
:accessory-text current-log-level
:chevron true}
{:size :small
:title (i18n/label :t/fleet)
:accessibility-label :fleet-settings-button
:on-press
#(re-frame/dispatch [:navigate-to :fleet-settings])
:accessory :text
:accessory-text current-fleet
:chevron true}
{:size :small
:title (i18n/label :t/bootnodes)
:accessibility-label :bootnodes-settings-button
:on-press
#(re-frame/dispatch [:navigate-to :bootnodes-settings])
:chevron true}
{:size :small
:title (i18n/label :t/rpc-usage-info)
:accessibility-label :rpc-usage-info
:container-margin-top 8
:on-press
#(re-frame/dispatch [:navigate-to :rpc-usage-info])
:chevron true}
(when platform/ios?
{:size :small
:title (i18n/label :t/notification-settings)
:accessibility-label :advanced-notification-settings
:on-press
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
:chevron true})
{:size :small
:title (i18n/label :t/communities-enabled)
:accessibility-label :communities-enabled
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/switch-communities-enabled (not communities-enabled?)])
:accessory :switch
:active communities-enabled?}
{:size :small
:title "Webview debug"
:accessibility-label :webview-debug-switch
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/switch-webview-debug (not webview-debug)])
:accessory :switch
:active webview-debug}
{:size :small
:title (i18n/label :t/waku-bloom-filter-mode)
:accessibility-label :waku-bloom-filter-mode-settings-switch
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
:accessory :switch
:active waku-bloom-filter-mode}])
(keep
identity
[{:size :small
:title (i18n/label :t/network)
:accessibility-label :network-button
:container-margin-top 8
:on-press
#(re-frame/dispatch [:navigate-to :network-settings])
:accessory :text
:accessory-text network-name
:chevron true}
{:size :small
:title (i18n/label :t/network-info)
:accessibility-label :network-button
:container-margin-top 8
:on-press
#(re-frame/dispatch [:navigate-to :network-info])
:chevron true}
{:size :small
:title (i18n/label :t/log-level)
:accessibility-label :log-level-settings-button
:on-press
#(re-frame/dispatch [:navigate-to :log-level-settings])
:accessory :text
:accessory-text current-log-level
:chevron true}
{:size :small
:title (i18n/label :t/fleet)
:accessibility-label :fleet-settings-button
:on-press
#(re-frame/dispatch [:navigate-to :fleet-settings])
:accessory :text
:accessory-text current-fleet
:chevron true}
{:size :small
:title (i18n/label :t/bootnodes)
:accessibility-label :bootnodes-settings-button
:on-press
#(re-frame/dispatch [:navigate-to :bootnodes-settings])
:chevron true}
{:size :small
:title (i18n/label :t/rpc-usage-info)
:accessibility-label :rpc-usage-info
:container-margin-top 8
:on-press
#(re-frame/dispatch [:navigate-to :rpc-usage-info])
:chevron true}
(when platform/ios?
{:size :small
:title (i18n/label :t/notification-settings)
:accessibility-label :advanced-notification-settings
:on-press
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
:chevron true})
;; If it's enabled in the config, we don't show the option
(when (not config/communities-enabled?)
{:size :small
:title (i18n/label :t/communities-enabled)
:accessibility-label :communities-enabled
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/switch-communities-enabled (not communities-enabled?)])
:accessory :switch
:active communities-enabled?})
{:size :small
:title "Webview debug"
:accessibility-label :webview-debug-switch
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/switch-webview-debug (not webview-debug)])
:accessory :switch
:active webview-debug}
{:size :small
:title (i18n/label :t/waku-bloom-filter-mode)
:accessibility-label :waku-bloom-filter-mode-settings-switch
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
:accessory :switch
:active waku-bloom-filter-mode}]))
(defn- flat-list-data [options]
(normal-mode-settings-data options))

View File

@ -2,7 +2,7 @@
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im",
"repo": "status-go",
"version": "feature/allow-set-mailserver-sync-value",
"commit-sha1": "26a367c8e269a85c278cfa25acfc892f5f4aba54",
"src-sha256": "1wraz35sjiyf2kq1yiga2gda7jvar4fvya1hdg9imfvffpgbs6aq"
"version": "v0.79.7",
"commit-sha1": "60de443e89bd6a5d4f5b71e7038528d27f26090b",
"src-sha256": "0gjgkqyvpbwg8drwi2mpcan5vxqrnrzl1j0ccmm2m8vq7j3b1332"
}