diff --git a/src/status_im/ethereum/subscriptions.cljs b/src/status_im/ethereum/subscriptions.cljs index d4a124d40f07..a7a5bccc4214 100644 --- a/src/status_im/ethereum/subscriptions.cljs +++ b/src/status_im/ethereum/subscriptions.cljs @@ -70,9 +70,9 @@ (rf/defn new-wallet-event [cofx {:keys [type blockNumber accounts] :as event}] (log/debug "[wallet-subs] new-wallet-event" - "event-type" type - "blockNumber" blockNumber - "accounts" accounts) + "event-type" type + "blockNumber" blockNumber + "accounts" accounts) (case type "new-transfers" (new-transfers cofx blockNumber accounts) "recent-history-fetching" (recent-history-fetching-started cofx accounts) diff --git a/src/status_im/wallet/core.cljs b/src/status_im/wallet/core.cljs index 5844fe978f7f..d60f10b513f8 100644 --- a/src/status_im/wallet/core.cljs +++ b/src/status_im/wallet/core.cljs @@ -1153,26 +1153,19 @@ #(async-storage/set-item! :invalid-ens-name-seen true))))) nil) -(re-frame/reg-fx - ::enable-local-notifications - (fn [] - (native-module/start-local-notifications))) - (rf/defn initialize-wallet {:events [:wallet-legacy/initialize-wallet]} [{:keys [db] :as cofx} accounts tokens custom-tokens favourites scan-all-tokens? new-account?] (rf/merge cofx - {:db (assoc db - :profile/wallet-accounts - (rpc->accounts accounts)) - ;; NOTE: Local notifications should be enabled only after wallet was started - ::enable-local-notifications nil - :dispatch-n [(when (or (not (utils.mobile-sync/syncing-allowed? cofx)) - (chain/binance-chain? db)) - [:transaction/get-fetched-transfers])] - :dispatch [:wallet/get-accounts-success accounts]} + {:db (assoc db + :profile/wallet-accounts + (rpc->accounts accounts)) + :dispatch-n [(when (or (not (utils.mobile-sync/syncing-allowed? cofx)) + (chain/binance-chain? db)) + [:transaction/get-fetched-transfers])] + :dispatch [:wallet/get-accounts-success accounts]} (check-invalid-ens) (initialize-tokens tokens custom-tokens) (initialize-favourites favourites) diff --git a/src/status_im2/contexts/profile/login/effects.cljs b/src/status_im2/contexts/profile/login/effects.cljs index 2f211dfbe7dd..d99fb11cf9af 100644 --- a/src/status_im2/contexts/profile/login/effects.cljs +++ b/src/status_im2/contexts/profile/login/effects.cljs @@ -9,3 +9,7 @@ ;;"node.login" signal will be triggered as a callback (native-module/login-account (assoc (profile.config/login) :keyUid key-uid :password hashed-password)))) + +(rf/reg-fx :effects.profile/enable-local-notifications + (fn [] + (native-module/start-local-notifications))) diff --git a/src/status_im2/contexts/profile/login/events.cljs b/src/status_im2/contexts/profile/login/events.cljs index 38ed0a0c1514..e62798f766ae 100644 --- a/src/status_im2/contexts/profile/login/events.cljs +++ b/src/status_im2/contexts/profile/login/events.cljs @@ -112,24 +112,28 @@ current-network-config (get networks current-network) network-id (str (get-in networks [current-network :config :NetworkId]))] - (rf/merge cofx - (cond-> {:json-rpc/call [{:method "wakuext_startMessenger" - :on-success #(re-frame/dispatch [:messenger-started %]) - :on-error #(log/error "failed to start messenger")}] - :check-eip1559-activation {:network-id network-id}} - (not (:universal-links/handling db)) - (assoc :effects.chat/open-last-chat (get-in db [:profile/profile :key-uid])) - notifications-enabled? - (assoc :effects/push-notifications-enable nil)) - (contacts/initialize-contacts) - (browser/initialize-browser) - (mobile-network/on-network-status-change) - (group-chats/get-group-chat-invitations) - (profile.settings.events/get-profile-picture) - (profile.settings.events/change-preview-privacy) - (link-preview/request-link-preview-whitelist) - (visibility-status-updates-store/fetch-visibility-status-updates-rpc) - (switcher-cards-store/fetch-switcher-cards-rpc)))) + (rf/merge + cofx + (cond-> {:json-rpc/call [{:method "wakuext_startMessenger" + :on-success #(re-frame/dispatch + [:messenger-started %]) + :on-error #(log/error + "failed to start messenger")}] + :check-eip1559-activation {:network-id network-id} + :effects.profile/enable-local-notifications nil} + (not (:universal-links/handling db)) + (assoc :effects.chat/open-last-chat (get-in db [:profile/profile :key-uid])) + notifications-enabled? + (assoc :effects/push-notifications-enable nil)) + (contacts/initialize-contacts) + (browser/initialize-browser) + (mobile-network/on-network-status-change) + (group-chats/get-group-chat-invitations) + (profile.settings.events/get-profile-picture) + (profile.settings.events/change-preview-privacy) + (link-preview/request-link-preview-whitelist) + (visibility-status-updates-store/fetch-visibility-status-updates-rpc) + (switcher-cards-store/fetch-switcher-cards-rpc)))) (rf/defn messenger-started {:events [:messenger-started]} diff --git a/src/status_im2/contexts/shell/jump_to/components/home_stack/view.cljs b/src/status_im2/contexts/shell/jump_to/components/home_stack/view.cljs index af3f7e962db6..8548e53a7d6d 100644 --- a/src/status_im2/contexts/shell/jump_to/components/home_stack/view.cljs +++ b/src/status_im2/contexts/shell/jump_to/components/home_stack/view.cljs @@ -3,7 +3,6 @@ [quo.theme :as quo.theme] [react-native.reanimated :as reanimated] [status-im.ui.screens.browser.stack :as browser.stack] - [status-im.ui.screens.wallet.accounts.views :as wallet.accounts] [status-im2.contexts.chat.home.view :as chat] [status-im2.contexts.communities.home.view :as communities] [status-im2.contexts.shell.jump-to.components.home-stack.style :as style]