Add peer syncing toggle in "Advanced settings" (#18906)
* Add peer syncing toggle in "Advanced settings" * status-go-version.json * Fixes
This commit is contained in:
parent
e783deb5af
commit
58e9ae0334
|
@ -20,7 +20,8 @@
|
|||
current-fleet
|
||||
webview-debug
|
||||
test-networks-enabled?
|
||||
is-goerli-enabled?]}]
|
||||
is-goerli-enabled?
|
||||
peer-syncing-enabled?]}]
|
||||
(keep
|
||||
identity
|
||||
[{:size :small
|
||||
|
@ -119,6 +120,14 @@
|
|||
#(re-frame/dispatch [:profile.settings/toggle-goerli-test-network])
|
||||
:accessory :switch
|
||||
:active is-goerli-enabled?}
|
||||
{:size :small
|
||||
:title "Peer syncing"
|
||||
:accessibility-label :peer-syncing
|
||||
:container-margin-bottom 8
|
||||
:on-press
|
||||
#(re-frame/dispatch [:profile.settings/toggle-peer-syncing])
|
||||
:accessory :switch
|
||||
:active peer-syncing-enabled?}
|
||||
{:size :small
|
||||
:title (i18n/label :t/set-currency)
|
||||
:accessibility-label :wallet-change-currency
|
||||
|
@ -145,7 +154,8 @@
|
|||
network-name [:network-name]
|
||||
transactions-management-enabled? [:wallet-legacy/transactions-management-enabled?]
|
||||
current-log-level [:log-level/current-log-level]
|
||||
current-fleet [:fleets/current-fleet]]
|
||||
current-fleet [:fleets/current-fleet]
|
||||
peer-syncing-enabled? [:profile/peer-syncing-enabled?]]
|
||||
[list/flat-list
|
||||
{:data (flat-list-data
|
||||
{:network-name network-name
|
||||
|
@ -156,6 +166,7 @@
|
|||
:dev-mode? false
|
||||
:webview-debug webview-debug
|
||||
:test-networks-enabled? test-networks-enabled?
|
||||
:is-goerli-enabled? is-goerli-enabled?})
|
||||
:is-goerli-enabled? is-goerli-enabled?
|
||||
:peer-syncing-enabled? peer-syncing-enabled?})
|
||||
:key-fn (fn [_ i] (str i))
|
||||
:render-fn render-item}]))
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
(ns status-im.contexts.profile.settings.events
|
||||
(:require [clojure.string :as string]
|
||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet.events]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.constants :as constants]
|
||||
status-im.contexts.profile.settings.effects
|
||||
[taoensso.timbre :as log]
|
||||
|
@ -91,6 +92,16 @@
|
|||
(boolean private?)
|
||||
{})))
|
||||
|
||||
(re-frame/reg-event-fx :profile.settings/toggle-peer-syncing
|
||||
(fn [{:keys [db]}]
|
||||
(let [value (get-in db [:profile/profile :peer-syncing-enabled?])
|
||||
new-value (not value)]
|
||||
{:db (assoc-in db [:profile/profile :peer-syncing-enabled?] new-value)
|
||||
:fx [[:json-rpc/call
|
||||
[{:method "wakuext_togglePeerSyncing"
|
||||
:params [{:enabled new-value}]
|
||||
:on-error #(log/error "failed to toggle peer syncing" new-value %)}]]]})))
|
||||
|
||||
(rf/defn change-profile-pictures-show-to
|
||||
{:events [:profile.settings/change-profile-pictures-show-to]}
|
||||
[cofx id]
|
||||
|
|
|
@ -111,6 +111,12 @@
|
|||
(fn [profile]
|
||||
(:is-goerli-enabled? profile)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:profile/peer-syncing-enabled?
|
||||
:<- [:profile/profile]
|
||||
(fn [profile]
|
||||
(:peer-syncing-enabled? profile)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:multiaccount/contact
|
||||
:<- [:profile/profile]
|
||||
|
|
Loading…
Reference in New Issue