Hide sensitive data from TestFairy

Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
This commit is contained in:
Dmitry Novotochinov 2018-04-16 13:09:07 +03:00
parent 02cd956f43
commit 4182cf566d
No known key found for this signature in database
GPG Key ID: 267674DCC86628D9
4 changed files with 15 additions and 17 deletions

6
package-lock.json generated
View File

@ -7265,9 +7265,9 @@
} }
}, },
"react-native-testfairy": { "react-native-testfairy": {
"version": "2.8.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/react-native-testfairy/-/react-native-testfairy-2.8.0.tgz", "resolved": "https://registry.npmjs.org/react-native-testfairy/-/react-native-testfairy-2.10.0.tgz",
"integrity": "sha512-wWQ8xaYq1enjZKM3C7T4jOHHkXW2mBwWoF1p64mbpk0tuFiyH2U1lr9FLNfYDaiqWkMN13iqzZjXciF0f+IS9Q==" "integrity": "sha512-l9Ywc69WTnraPuq5wZS7/GWcSuBxVKxaFzCIhsrIzWhByIh/1o/UqwRb8Eb06h8/e3IP7fd1LD5hXF2NMDRg3g=="
}, },
"react-native-udp": { "react-native-udp": {
"version": "2.2.1", "version": "2.2.1",

View File

@ -54,7 +54,7 @@
"react-native-splash-screen": "3.0.6", "react-native-splash-screen": "3.0.6",
"react-native-svg": "6.3.1", "react-native-svg": "6.3.1",
"react-native-tcp": "3.3.0", "react-native-tcp": "3.3.0",
"react-native-testfairy": "2.8.0", "react-native-testfairy": "2.10.0",
"react-native-udp": "2.2.1", "react-native-udp": "2.2.1",
"react-native-webview-bridge": "github:status-im/react-native-webview-bridge#fix-web3-injection", "react-native-webview-bridge": "github:status-im/react-native-webview-bridge#fix-web3-injection",
"realm": "2.3.3", "realm": "2.3.3",

View File

@ -20,10 +20,7 @@
(letsubs [error [:get-in [:accounts/recover :passphrase-error]] (letsubs [error [:get-in [:accounts/recover :passphrase-error]]
input-ref (reagent/atom nil)] input-ref (reagent/atom nil)]
{:component-did-mount (fn [_] (when config/testfairy-enabled? {:component-did-mount (fn [_] (when config/testfairy-enabled?
;; NOTE(dmitryn) Doesn't work on Android without setTimeout (.hideView js-dependencies/testfairy @input-ref)))}
(js/setTimeout
#(.hideView js-dependencies/testfairy @input-ref)
100)))}
[text-input/text-input-with-label [text-input/text-input-with-label
{:style components.styles/flex {:style components.styles/flex
:height 92 :height 92

View File

@ -63,10 +63,7 @@
(letsubs [mnemonic-vec (vec (map-indexed vector (clojure.string/split mnemonic #" "))) (letsubs [mnemonic-vec (vec (map-indexed vector (clojure.string/split mnemonic #" ")))
ref (reagent/atom nil)] ref (reagent/atom nil)]
{:component-did-mount (fn [_] (when config/testfairy-enabled? {:component-did-mount (fn [_] (when config/testfairy-enabled?
;; NOTE(dmitryn) Doesn't work on Android without setTimeout (.hideView js-dependencies/testfairy @ref)))}
(js/setTimeout
#(.hideView js-dependencies/testfairy @ref)
100)))}
[react/view {:style styles/twelve-words-container} [react/view {:style styles/twelve-words-container}
[react/text {:style styles/twelve-words-label} [react/text {:style styles/twelve-words-label}
(i18n/label :t/your-seed-phrase)] (i18n/label :t/your-seed-phrase)]
@ -84,11 +81,15 @@
:on-press #(re-frame/dispatch [:my-profile/enter-two-random-words])}]]])) :on-press #(re-frame/dispatch [:my-profile/enter-two-random-words])}]]]))
(defview input [error] (defview input [error]
(letsubs [ref (reagent/atom nil)]
{:component-did-mount (fn [_] (when config/testfairy-enabled?
(.hideView js-dependencies/testfairy @ref)))}
[text-input/text-input-with-label [text-input/text-input-with-label
{:placeholder (i18n/label :t/enter-word) {:placeholder (i18n/label :t/enter-word)
:ref (partial reset! ref)
:auto-focus true :auto-focus true
:on-change-text #(re-frame/dispatch [:set-in [:my-profile/seed :word] %]) :on-change-text #(re-frame/dispatch [:set-in [:my-profile/seed :word] %])
:error error}]) :error error}]))
(defn enter-word [step [idx word] error entered-word] (defn enter-word [step [idx word] error entered-word]
^{:key word} ^{:key word}