process backedup(profile/settings) signal (#17306)
This commit is contained in:
parent
6eb53ca2db
commit
cb9ae21cf2
|
@ -145,5 +145,9 @@
|
||||||
(js->clj event-js :keywordize-keys true))
|
(js->clj event-js :keywordize-keys true))
|
||||||
"curated.communities.update" (rf/dispatch [:fetched-contract-communities
|
"curated.communities.update" (rf/dispatch [:fetched-contract-communities
|
||||||
(js->clj event-js :keywordize-keys true)])
|
(js->clj event-js :keywordize-keys true)])
|
||||||
|
"waku.backedup.profile" (rf/dispatch [:profile/update-profile-from-backup
|
||||||
|
(js->clj event-js :keywordize-keys true)])
|
||||||
|
"waku.backedup.settings" (rf/dispatch [:profile/update-setting-from-backup
|
||||||
|
(js->clj event-js :keywordize-keys true)])
|
||||||
|
|
||||||
(log/debug "Event " type " not handled"))))
|
(log/debug "Event " type " not handled"))))
|
||||||
|
|
|
@ -47,3 +47,13 @@
|
||||||
;;if succeed "node.login" signal will be triggered
|
;;if succeed "node.login" signal will be triggered
|
||||||
(login/login-with-biometric-if-available key-uid)))
|
(login/login-with-biometric-if-available key-uid)))
|
||||||
(navigation/init-root cofx :intro)))
|
(navigation/init-root cofx :intro)))
|
||||||
|
|
||||||
|
(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)})
|
||||||
|
|
||||||
|
(rf/defn update-profile-from-backup
|
||||||
|
{:events [:profile/update-profile-from-backup]}
|
||||||
|
[_ {{:keys [ensUsernameDetails]} :backedUpProfile}]
|
||||||
|
{:dispatch [:ens/update-usernames ensUsernameDetails]})
|
||||||
|
|
Loading…
Reference in New Issue