Skip to content

Commit

Permalink
[Fix] Currency symbol on recovered profile (#18433)
Browse files Browse the repository at this point in the history
This commit fixes the currency symbol not shown on the recovered profile.

--

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
  • Loading branch information
smohamedjavid authored Jan 19, 2024
1 parent e871357 commit 5926426
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/legacy/status_im/data_store/settings.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@
(visibility-status-updates/<-rpc-settings)
(set/rename-keys {:compressedKey :compressed-key
:emojiHash :emoji-hash})))

(defn rpc->setting-value
[{:keys [name] :as setting}]
(condp = name
:currency (update setting :value keyword)
setting))
7 changes: 5 additions & 2 deletions src/status_im/contexts/profile/events.cljs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns status-im.contexts.profile.events
(:require
[legacy.status-im.data-store.settings :as data-store.settings]
[native-module.core :as native-module]
[re-frame.core :as re-frame]
[status-im.contexts.profile.edit.name.events]
Expand Down Expand Up @@ -52,8 +53,10 @@

(rf/defn update-setting-from-backup
{:events [:profile/update-setting-from-backup]}
[{:keys [db]} {{:keys [name value]} :backedUpSettings}]
{:db (assoc-in db [:profile/profile (keyword name)] value)})
[{:keys [db]} {:keys [backedUpSettings]}]
(let [setting (update backedUpSettings :name keyword)
{:keys [name value]} (data-store.settings/rpc->setting-value setting)]
{:db (assoc-in db [:profile/profile name] value)}))

(rf/defn update-profile-from-backup
{:events [:profile/update-profile-from-backup]}
Expand Down

0 comments on commit 5926426

Please sign in to comment.