Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of ratom to fix wallet share #18883

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/status_im/contexts/shell/share/wallet/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(fn []
[network-preferences/view
{:blur? true
:selected-networks (set selected-networks)
:selected-networks (set @selected-networks)
:on-save (fn [chain-ids]
(rf/dispatch [:hide-bottom-sheet])
(reset! selected-networks (map #(get utils/id->network %)
Expand All @@ -48,7 +48,10 @@
[props]
(let [{:keys [account width index]} props
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])
wallet-type (reagent/atom :legacy)]
wallet-type (reagent/atom :legacy)
on-settings-press #(open-preferences selected-networks)
on-legacy-press #(reset! wallet-type :legacy)
on-multichain-press #(reset! wallet-type :multichain)]
(fn []
(let [share-title (str (:name account) " " (i18n/label :t/address))
qr-url (utils/get-wallet-qr {:wallet-type @wallet-type
Expand All @@ -72,9 +75,9 @@
:full-name (:name account)
:customization-color (:color account)
:emoji (:emoji account)
:on-multichain-press #(reset! wallet-type :multichain)
:on-legacy-press #(reset! wallet-type :legacy)
:on-settings-press #(open-preferences @selected-networks)}]]]))))
:on-multichain-press on-multichain-press
:on-legacy-press on-legacy-press
:on-settings-press on-settings-press}]]]))))

(def wallet-qr-code-item (memoize wallet-qr-code-item-internal))

Expand Down
19 changes: 11 additions & 8 deletions src/status_im/contexts/wallet/share_address/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@

(defn view
[]
(let [padding-top (:top (safe-area/get-insets))
wallet-type (reagent/atom :legacy)
;; Design team is yet to confirm the default selected networks here.
;; Should be the current selected for the account or all the networks always
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])]
(let [padding-top (:top (safe-area/get-insets))
wallet-type (reagent/atom :legacy)
;; Design team is yet to confirm the default selected networks here. Should be the current
;; selected for the account or all the networks always
selected-networks (reagent/atom [:ethereum :optimism :arbitrum])
on-settings-press #(open-preferences selected-networks)
on-legacy-press #(reset! wallet-type :legacy)
on-multichain-press #(reset! wallet-type :multichain)]
(fn []
(let [{:keys [address color emoji watch-only?]
:as account} (rf/sub [:wallet/current-viewing-account])
Expand Down Expand Up @@ -97,6 +100,6 @@
:full-name (:name account)
:customization-color color
:emoji emoji
:on-legacy-press #(reset! wallet-type :legacy)
:on-multichain-press #(reset! wallet-type :multichain)
:on-settings-press #(open-preferences selected-networks)}]]]]))))
:on-legacy-press on-legacy-press
:on-multichain-press on-multichain-press
:on-settings-press on-settings-press}]]]]))))