Skip to content

Commit aa1410a

Browse files
committed
process backedup(profile/settings) signal
1 parent 6eb53ca commit aa1410a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/status_im/signals/core.cljs

+4
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,9 @@
145145
(js->clj event-js :keywordize-keys true))
146146
"curated.communities.update" (rf/dispatch [:fetched-contract-communities
147147
(js->clj event-js :keywordize-keys true)])
148+
"waku.backedup.profile" (rf/dispatch [:profile/update-profile-from-backup
149+
(js->clj event-js :keywordize-keys true)])
150+
"waku.backedup.settings" (rf/dispatch [:profile/update-setting-from-backup
151+
(js->clj event-js :keywordize-keys true)])
148152

149153
(log/debug "Event " type " not handled"))))

src/status_im2/contexts/profile/events.cljs

+10
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,13 @@
4747
;;if succeed "node.login" signal will be triggered
4848
(login/login-with-biometric-if-available key-uid)))
4949
(navigation/init-root cofx :intro)))
50+
51+
(rf/defn update-setting-from-backup
52+
{:events [:profile/update-setting-from-backup]}
53+
[{:keys [db]} {{:keys [name value]} :backedUpSettings}]
54+
{:db (assoc-in db [:profile/profile (keyword name)] value)})
55+
56+
(rf/defn update-profile-from-backup
57+
{:events [:profile/update-profile-from-backup]}
58+
[_ {{:keys [ensUsernameDetails]} :backedUpProfile}]
59+
{:dispatch [:ens/update-usernames ensUsernameDetails]})

0 commit comments

Comments
 (0)