mirror of
https://github.com/status-im/status-react.git
synced 2025-01-12 12:04:52 +00:00
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
|
current-fleet
|
||||||
webview-debug
|
webview-debug
|
||||||
test-networks-enabled?
|
test-networks-enabled?
|
||||||
is-goerli-enabled?]}]
|
is-goerli-enabled?
|
||||||
|
peer-syncing-enabled?]}]
|
||||||
(keep
|
(keep
|
||||||
identity
|
identity
|
||||||
[{:size :small
|
[{:size :small
|
||||||
@ -119,6 +120,14 @@
|
|||||||
#(re-frame/dispatch [:profile.settings/toggle-goerli-test-network])
|
#(re-frame/dispatch [:profile.settings/toggle-goerli-test-network])
|
||||||
:accessory :switch
|
:accessory :switch
|
||||||
:active is-goerli-enabled?}
|
: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
|
{:size :small
|
||||||
:title (i18n/label :t/set-currency)
|
:title (i18n/label :t/set-currency)
|
||||||
:accessibility-label :wallet-change-currency
|
:accessibility-label :wallet-change-currency
|
||||||
@ -145,7 +154,8 @@
|
|||||||
network-name [:network-name]
|
network-name [:network-name]
|
||||||
transactions-management-enabled? [:wallet-legacy/transactions-management-enabled?]
|
transactions-management-enabled? [:wallet-legacy/transactions-management-enabled?]
|
||||||
current-log-level [:log-level/current-log-level]
|
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
|
[list/flat-list
|
||||||
{:data (flat-list-data
|
{:data (flat-list-data
|
||||||
{:network-name network-name
|
{:network-name network-name
|
||||||
@ -156,6 +166,7 @@
|
|||||||
:dev-mode? false
|
:dev-mode? false
|
||||||
:webview-debug webview-debug
|
:webview-debug webview-debug
|
||||||
:test-networks-enabled? test-networks-enabled?
|
: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))
|
:key-fn (fn [_ i] (str i))
|
||||||
:render-fn render-item}]))
|
:render-fn render-item}]))
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
(ns status-im.contexts.profile.settings.events
|
(ns status-im.contexts.profile.settings.events
|
||||||
(:require [clojure.string :as string]
|
(:require [clojure.string :as string]
|
||||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet.events]
|
[legacy.status-im.bottom-sheet.events :as bottom-sheet.events]
|
||||||
|
[re-frame.core :as re-frame]
|
||||||
[status-im.constants :as constants]
|
[status-im.constants :as constants]
|
||||||
status-im.contexts.profile.settings.effects
|
status-im.contexts.profile.settings.effects
|
||||||
[taoensso.timbre :as log]
|
[taoensso.timbre :as log]
|
||||||
@ -91,6 +92,16 @@
|
|||||||
(boolean private?)
|
(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
|
(rf/defn change-profile-pictures-show-to
|
||||||
{:events [:profile.settings/change-profile-pictures-show-to]}
|
{:events [:profile.settings/change-profile-pictures-show-to]}
|
||||||
[cofx id]
|
[cofx id]
|
||||||
|
@ -111,6 +111,12 @@
|
|||||||
(fn [profile]
|
(fn [profile]
|
||||||
(:is-goerli-enabled? 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
|
(re-frame/reg-sub
|
||||||
:multiaccount/contact
|
:multiaccount/contact
|
||||||
:<- [:profile/profile]
|
:<- [:profile/profile]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user