From 59264266727abcf9836b084a72940d12babd02ed Mon Sep 17 00:00:00 2001 From: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:03:28 +0530 Subject: [PATCH] [Fix] Currency symbol on recovered profile (#18433) This commit fixes the currency symbol not shown on the recovered profile. -- Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> --- src/legacy/status_im/data_store/settings.cljs | 6 ++++++ src/status_im/contexts/profile/events.cljs | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/legacy/status_im/data_store/settings.cljs b/src/legacy/status_im/data_store/settings.cljs index 90f3af65ae..0e8508d45d 100644 --- a/src/legacy/status_im/data_store/settings.cljs +++ b/src/legacy/status_im/data_store/settings.cljs @@ -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)) diff --git a/src/status_im/contexts/profile/events.cljs b/src/status_im/contexts/profile/events.cljs index 4826b27b47..61dafe24a9 100644 --- a/src/status_im/contexts/profile/events.cljs +++ b/src/status_im/contexts/profile/events.cljs @@ -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] @@ -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]}