Skip to content

Commit

Permalink
[Fix] Broken wallet account emoji when syncing devices
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
  • Loading branch information
smohamedjavid committed Feb 15, 2024
1 parent 2e13cfc commit 3cd4ae1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/status_im/contexts/wallet/data_store.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
[account]
(assoc account :watch-only? (= (:type account) :watch)))

(defn- sanitize-emoji
"As Desktop uses Twemoji, the emoji received can be an img tag
with raw emoji in alt attribute. This function help us to extract
the emoji from it as mobile doesn't support HTML rendering and Twemoji"
[emoji]
(if (string/starts-with? emoji "<img")
(-> (re-find #"alt=\"(.*?)\"" emoji) last)
emoji))

(defn rpc->account
[account]
(-> account
Expand All @@ -33,6 +42,7 @@
(update :test-preferred-chain-ids chain-ids-string->set)
(update :type keyword)
(update :color #(if (seq %) (keyword %) constants/account-default-customization-color))
(update :emoji sanitize-emoji)
(assoc :default-account? (:wallet account))
add-keys-to-account))

Expand Down

0 comments on commit 3cd4ae1

Please sign in to comment.