Skip to content

Commit 5d9bca4

Browse files
committed
Fix issues due to JS object comparison and manipulation
1 parent 3a60c68 commit 5d9bca4

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

src/react_native/fast_image.cljs

+10-13
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
(:require
33
["react-native-fast-image" :as FastImage]
44
[clojure.string :as string]
5-
[oops.core :as oops]
65
[react-native.core :as rn]
7-
[reagent.core :as reagent]))
6+
[reagent.core :as reagent]
7+
[utils.transforms :as transforms]))
88

99
(defn- build-source
1010
[source]
@@ -14,12 +14,10 @@
1414
source))
1515

1616
(defn- remove-port
17-
[^js/Object source]
17+
[source]
1818
(cond
19-
(string? source) (string/replace-first source #":\d+" "")
20-
(.hasOwnProperty source "uri") (some-> source
21-
(oops/oget "uri")
22-
(string/replace-first #":\d+" ""))
19+
(string? source) (string/replace-first source #":\d+" "")
20+
(:uri source) (some-> source :uri (string/replace-first #":\d+" ""))
2321
:else source))
2422

2523
(defn- placeholder
@@ -61,13 +59,12 @@
6159

6260
(defn- compare-props
6361
[old-props new-props]
64-
;; NOTE: We copy the object because during component tests the original is frozen
65-
(let [old-source (some-> old-props (oops/oget "source") remove-port)
66-
new-source (some-> new-props (oops/oget "source") remove-port)
67-
old-other-props (js-delete (js/Object.assign #js {} old-props) "source")
68-
new-other-props (js-delete (js/Object.assign #js {} new-props) "source")]
62+
(let [old-props-clj (transforms/js->clj old-props)
63+
new-props-clj (transforms/js->clj new-props)
64+
old-source (some-> old-props-clj :source remove-port)
65+
new-source (some-> new-props-clj :source remove-port)]
6966
(and (= old-source new-source)
70-
(= old-other-props new-other-props))))
67+
(= (dissoc old-props-clj :source) (dissoc new-props-clj :source)))))
7168

7269
(def fast-image
7370
(-> internal-fast-image

src/status_im/common/standard_authentication/forgot_password_doc/view.cljs

+5-10
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
[quo/documentation-drawers
1111
{:title (i18n/label :t/forgot-your-password-info-title)
1212
:shell? shell?}
13-
[rn/view
14-
{:style style/container}
13+
[rn/view {:style style/container}
1514
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-description)]
1615

1716
[rn/view {:style style/step-container}
1817
[quo/step {:in-blur-view? shell?} 1]
19-
[rn/view
20-
{:style style/step-content}
18+
[rn/view {:style style/step-content}
2119
[quo/text {:size :paragraph-2 :weight :semi-bold}
2220
(i18n/label :t/forgot-your-password-info-remove-app)]
2321
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-remove-app-description)]]]
@@ -33,10 +31,8 @@
3331

3432
[rn/view {:style style/step-container}
3533
[quo/step {:in-blur-view? shell?} 3]
36-
[rn/view
37-
{:style style/step-content}
38-
[rn/view
39-
{:style style/step-title}
34+
[rn/view {:style style/step-content}
35+
[rn/view {:style style/step-title}
4036
[quo/text {:size :paragraph-2} (str (i18n/label :t/sign-up) " ")]
4137
[quo/text {:size :paragraph-2 :weight :semi-bold}
4238
(i18n/label :t/forgot-your-password-info-signup-with-key)]]
@@ -45,8 +41,7 @@
4541

4642
[rn/view {:style style/step-container}
4743
[quo/step {:in-blur-view? shell?} 4]
48-
[rn/view
49-
{:style style/step-content}
44+
[rn/view {:style style/step-content}
5045
[quo/text {:size :paragraph-2 :weight :semi-bold}
5146
(i18n/label :t/forgot-your-password-info-create-new-password)]
5247
[quo/text {:size :paragraph-2}

0 commit comments

Comments
 (0)