refactor_: Remove unnecessary indirection

This commit is contained in:
Icaro Motta 2024-06-05 19:08:50 -03:00
parent 9b86ea8980
commit 7af9c781e3
No known key found for this signature in database
GPG Key ID: 009557D9D014DF07
1 changed files with 4 additions and 8 deletions

View File

@ -53,7 +53,10 @@
(assoc-in [:activity-center :loading?] true)) (assoc-in [:activity-center :loading?] true))
pairing-completed? pairing-completed?
(dissoc :syncing)) (dissoc :syncing))
:fx (into [[:dispatch [:profile.login/start-messenger]] :fx (into [[:json-rpc/call
[{:method "wakuext_startMessenger"
:on-success [:profile.login/messenger-started]
:on-error #(log/error "failed to start messenger" %)}]]
[:dispatch [:universal-links/generate-profile-url]] [:dispatch [:universal-links/generate-profile-url]]
[:dispatch [:community/fetch]] [:dispatch [:community/fetch]]
[:dispatch [:wallet/initialize]] [:dispatch [:wallet/initialize]]
@ -107,13 +110,6 @@
(when notifications-enabled? (when notifications-enabled?
[:effects/push-notifications-enable])]}))) [:effects/push-notifications-enable])]})))
(rf/reg-event-fx :profile.login/start-messenger
(fn []
{:fx [[:json-rpc/call
[{:method "wakuext_startMessenger"
:on-success [:profile.login/messenger-started]
:on-error #(log/error "failed to start messenger" %)}]]]}))
(rf/reg-event-fx :profile.login/messenger-started (rf/reg-event-fx :profile.login/messenger-started
(fn [{:keys [db]} [{:keys [mailservers]}]] (fn [{:keys [db]} [{:keys [mailservers]}]]
(let [new-account? (get db :onboarding/new-account?)] (let [new-account? (get db :onboarding/new-account?)]