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] Broken wallet account emoji when syncing devices #18828

Merged
merged 1 commit into from
Feb 15, 2024
Merged
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
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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should add a comment to the purpose of this

(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