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] (defn get-item [k cb]
(-> ^js async-storage (-> ^js async-storage
(.getItem (key->string k)) (.getItem (key->string k))
(.then cb) (.then (fn [^js data]
(-> data
js->clj
transit->clj
cb)))
(.catch (fn [error] (.catch (fn [error]
(cb nil) (cb nil)
(log/error "[async-storage]" error))))) (log/error "[async-storage]" error)))))

View File

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

View File

@ -2,6 +2,7 @@
(:require [re-frame.core :as re-frame] (:require [re-frame.core :as re-frame]
[status-im.i18n.i18n :as i18n] [status-im.i18n.i18n :as i18n]
[quo.core :as quo] [quo.core :as quo]
[status-im.utils.config :as config]
[status-im.utils.platform :as platform] [status-im.utils.platform :as platform]
[status-im.ui.components.list.views :as list] [status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react] [status-im.ui.components.react :as react]
@ -14,6 +15,8 @@
communities-enabled? communities-enabled?
current-fleet current-fleet
webview-debug]}] webview-debug]}]
(keep
identity
[{:size :small [{:size :small
:title (i18n/label :t/network) :title (i18n/label :t/network)
:accessibility-label :network-button :accessibility-label :network-button
@ -66,6 +69,8 @@
:on-press :on-press
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings]) #(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
:chevron true}) :chevron true})
;; If it's enabled in the config, we don't show the option
(when (not config/communities-enabled?)
{:size :small {:size :small
:title (i18n/label :t/communities-enabled) :title (i18n/label :t/communities-enabled)
:accessibility-label :communities-enabled :accessibility-label :communities-enabled
@ -74,7 +79,7 @@
#(re-frame/dispatch #(re-frame/dispatch
[:multiaccounts.ui/switch-communities-enabled (not communities-enabled?)]) [:multiaccounts.ui/switch-communities-enabled (not communities-enabled?)])
:accessory :switch :accessory :switch
:active communities-enabled?} :active communities-enabled?})
{:size :small {:size :small
:title "Webview debug" :title "Webview debug"
:accessibility-label :webview-debug-switch :accessibility-label :webview-debug-switch
@ -92,7 +97,7 @@
#(re-frame/dispatch #(re-frame/dispatch
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)]) [:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
:accessory :switch :accessory :switch
:active waku-bloom-filter-mode}]) :active waku-bloom-filter-mode}]))
(defn- flat-list-data [options] (defn- flat-list-data [options]
(normal-mode-settings-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", "_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im", "owner": "status-im",
"repo": "status-go", "repo": "status-go",
"version": "feature/allow-set-mailserver-sync-value", "version": "v0.79.7",
"commit-sha1": "26a367c8e269a85c278cfa25acfc892f5f4aba54", "commit-sha1": "60de443e89bd6a5d4f5b71e7038528d27f26090b",
"src-sha256": "1wraz35sjiyf2kq1yiga2gda7jvar4fvya1hdg9imfvffpgbs6aq" "src-sha256": "0gjgkqyvpbwg8drwi2mpcan5vxqrnrzl1j0ccmm2m8vq7j3b1332"
} }