Skip to content

Commit

Permalink
Add Test Networks Enabled option in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayesivan committed Dec 5, 2023
1 parent fe20fa4 commit b62f6b6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/status_im/ui/screens/advanced_settings/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
transactions-management-enabled?
wakuv2-flag
current-fleet
webview-debug]}]
webview-debug
test-networks-enabled?]}]
(keep
identity
[{:size :small
Expand Down Expand Up @@ -95,6 +96,15 @@
[:profile.settings/change-webview-debug (not webview-debug)])
:accessory :switch
:active webview-debug}
{:size :small
:title "Test Networks Enabled"
:accessibility-label :test-networks-enabled
:container-margin-bottom 8
:on-press
#(re-frame/dispatch
[:profile.settings/change-test-networks-enabled (not test-networks-enabled?)])
:accessory :switch
:active test-networks-enabled?}
{:size :small
:title (i18n/label :t/waku-bloom-filter-mode)
:accessibility-label :waku-bloom-filter-mode-settings-switch
Expand All @@ -117,7 +127,8 @@

(views/defview advanced-settings
[]
(views/letsubs [{:keys [webview-debug]} [:profile/profile]
(views/letsubs [{:keys [webview-debug
test-networks-enabled?]} [:profile/profile]
network-name [:network-name]
waku-bloom-filter-mode [:waku/bloom-filter-mode]
wakuv2-flag [:waku/v2-flag]
Expand All @@ -133,6 +144,7 @@
:dev-mode? false
:wakuv2-flag wakuv2-flag
:waku-bloom-filter-mode waku-bloom-filter-mode
:webview-debug webview-debug})
:webview-debug webview-debug
:test-networks-enabled? test-networks-enabled?})
:key-fn (fn [_ i] (str i))
:render-fn render-item}]))
1 change: 1 addition & 0 deletions src/status_im2/contexts/communities/discover/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@

(defn- internal-discover-view
[params]
(rf/dispatch [:fetch-contract-communities])
[:f> f-view-internal params])

(def view (quo.theme/with-theme internal-discover-view))
5 changes: 5 additions & 0 deletions src/status_im2/contexts/profile/settings/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
:on-success #(log/debug "sent contact update")}]}))

(rf/defn profile-update
{:events [:profile.settings/profile-update]}
[{:keys [db] :as cofx}
setting setting-value
{:keys [dont-sync? on-success] :or {on-success #()}}]
Expand Down Expand Up @@ -56,6 +57,10 @@
{:profile.settings/webview-debug-changed value}
(profile-update :webview-debug (boolean value) {})))

(rf/reg-event-fx :profile.settings/change-test-networks-enabled
(fn [_ [value]]
{:fx [[:dispatch [:profile.settings/profile-update :test-networks-enabled? (boolean value) {}]]]}))

(rf/defn change-preview-privacy-flag
{:events [:profile.settings/change-preview-privacy]}
[{:keys [db] :as cofx} private?]
Expand Down

0 comments on commit b62f6b6

Please sign in to comment.