From f65918c6181170483a8f68e185694de521d453f2 Mon Sep 17 00:00:00 2001 From: Mohsen Date: Mon, 5 Feb 2024 14:26:45 +0300 Subject: [PATCH] [#18453] fix: save accent color from signal response --- .../chat/messenger/messages/transport/events.cljs | 2 +- .../profile/edit/accent_colour/events.cljs | 14 +++++++++----- status-go-version.json | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/status_im/contexts/chat/messenger/messages/transport/events.cljs b/src/status_im/contexts/chat/messenger/messages/transport/events.cljs index d5d12ab94c92..754d76f419f2 100644 --- a/src/status_im/contexts/chat/messenger/messages/transport/events.cljs +++ b/src/status_im/contexts/chat/messenger/messages/transport/events.cljs @@ -212,7 +212,7 @@ (js-delete response-js "customizationColor") (rf/merge cofx (process-next response-js sync-handler) - (rf/dispatch [:profile/edit-accent-colour customization-color])))))) + (rf/dispatch [:profile/save-local-accent-color (keyword customization-color)])))))) (defn group-by-and-update-unviewed-counts "group messages by current chat, profile updates, transactions and update unviewed counters in db for not curent chats" diff --git a/src/status_im/contexts/profile/edit/accent_colour/events.cljs b/src/status_im/contexts/profile/edit/accent_colour/events.cljs index 89efd29a5710..8ce5ec7298d9 100644 --- a/src/status_im/contexts/profile/edit/accent_colour/events.cljs +++ b/src/status_im/contexts/profile/edit/accent_colour/events.cljs @@ -4,23 +4,27 @@ [utils.re-frame :as rf])) (rf/reg-event-fx :profile/edit-accent-colour-success - (fn [_] - {:fx [[:dispatch [:navigate-back]] + (fn [_ [customization-color]] + {:fx [[:dispatch [:profile/save-local-accent-color customization-color]] + [:dispatch [:navigate-back]] [:dispatch [:toasts/upsert {:type :positive :theme :dark :text (i18n/label :t/accent-colour-updated)}]]]})) +(rf/reg-event-fx :profile/save-local-accent-color + (fn [{:keys [db]} [customization-color]] + {:db (assoc-in db [:profile/profile :customization-color] customization-color)})) + (defn edit-accent-colour [{:keys [db]} [customization-color]] (let [key-uid (get-in db [:profile/profile :key-uid])] - {:db (assoc-in db [:profile/profile :customization-color] customization-color) - :fx [[:json-rpc/call + {:fx [[:json-rpc/call [{:method "wakuext_setCustomizationColor" :params [{:customizationColor customization-color :keyUid key-uid}] - :on-success [:profile/edit-accent-colour-success] + :on-success [:profile/edit-accent-colour-success customization-color] :on-error #(log/error "failed to edit accent color." {:error %})}]]]})) (rf/reg-event-fx :profile/edit-accent-colour edit-accent-colour) diff --git a/status-go-version.json b/status-go-version.json index 9119195cc360..01725148c890 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -4,6 +4,6 @@ "owner": "status-im", "repo": "status-go", "version": "feat/change-accent-colour", - "commit-sha1": "af7f5c4404a3edb0d2d14a91d75460b10a4cdc2c", - "src-sha256": "1bpcyjcgh0baw1pdqlm3ndm8in823pcfimn8zwdvqisxcj35sl2m" + "commit-sha1": "3b9d813f4b1d815c11f56abc93c4d6bfe16d4b5b", + "src-sha256": "0grzw3fa9b25ph6i64inwbsr9nrgs2jzgz9v3db88q8jwlwn15sz" }