Skip to content

Commit a93cb0b

Browse files
committed
show testfairy warning on startup (status-im#1569)
1 parent 1fe1730 commit a93cb0b

5 files changed

Lines changed: 36 additions & 9 deletions

File tree

react-native/src/status_im/react_native/js_dependencies.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
(def android-sms-listener (js/require "react-native-android-sms-listener"))
55
(def autolink (js/require "react-native-autolink"))
66
(def camera (js/require "react-native-camera"))
7+
(def config (js/require "react-native-config"))
78
;; TODO see https://github.com/rt2zz/react-native-contacts/issues/45
89
(def contacts (js/require "react-native-contacts"))
910
(def dialogs (js/require "react-native-dialogs"))

src/status_im/translations/en.cljs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,8 @@
322322
:contract-creation "Contract Creation"
323323

324324
;:webview
325-
:web-view-error "oops, error"})
325+
:web-view-error "oops, error"
326+
327+
;;testfairy warning
328+
:testfairy-title "Warning!"
329+
:testfairy-message "You are using app installed from a nightly build. For testing purposes this build includes session recording if wifi connection is used, so all your interaction with app is saved (as video and log) and might be used by development team to investigate possible issues. Saved video/log do not include your passwords. Recording is done only if app is installed from a nightly build. Nothing is recorded if app is installed from PlayStore or TestFlight."})

src/status_im/ui/screens/events.cljs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
[status-im.constants :refer [console-chat-id]]
3131
[status-im.utils.instabug :as inst]
3232
[status-im.utils.platform :as platform]
33-
[status-im.js-dependencies :as dependencies]))
33+
[status-im.js-dependencies :as dependencies]
34+
[status-im.utils.utils :as utils]
35+
[status-im.utils.config :as config]
36+
[status-im.i18n :as i18n]))
3437

3538
;;;; COFX
3639

@@ -93,6 +96,14 @@
9396
(fn [[permissions then else]]
9497
(permissions/request-permissions permissions then else)))
9598

99+
(reg-fx
100+
::testfairy-alert
101+
(fn []
102+
(when config/testfairy-enabled?
103+
(utils/show-popup
104+
(i18n/label :testfairy-title)
105+
(i18n/label :testfairy-message)))))
106+
96107
;;;; Handlers
97108

98109
(register-handler-db
@@ -108,12 +119,13 @@
108119
(register-handler-fx
109120
:initialize-app
110121
(fn [_ _]
111-
{:dispatch-n [[:initialize-db]
112-
[:load-accounts]
113-
[:check-console-chat]
114-
[:listen-to-network-status!]
115-
[:initialize-crypt]
116-
[:initialize-geth]]}))
122+
{::testfairy-alert nil
123+
:dispatch-n [[:initialize-db]
124+
[:load-accounts]
125+
[:check-console-chat]
126+
[:listen-to-network-status!]
127+
[:initialize-crypt]
128+
[:initialize-geth]]}))
117129

118130
(register-handler-fx
119131
:initialize-db
@@ -252,4 +264,4 @@
252264
(register-handler-db
253265
:update-geolocation
254266
(fn [db [_ geolocation]]
255-
(assoc db :geolocation geolocation)))
267+
(assoc db :geolocation geolocation)))

src/status_im/utils/config.cljs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(ns status-im.utils.config
2+
(:require [status-im.react-native.js-dependencies :as rn-dependencies]))
3+
4+
(def config (js->clj (.-default rn-dependencies/config) :keywordize-keys true))
5+
6+
(defn get-config [k]
7+
(get config k))
8+
9+
(def testfairy-enabled? (= "1" (get-config :TESTFAIRY_ENABLED)))

test/cljs/status_im/react_native/js_dependencies.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
(def action-button #js {})
44
(def android-sms-listener #js {})
55
(def autolink #js {:default #js {}})
6+
(def config #js {:default #js {}})
67
(def camera #js {:constants #js {}})
78
(def circle-checkbox #js {})
89
(def contacts #js {})

0 commit comments

Comments
 (0)