From de6d9a6c3b93bec02ae8e8ee139b8d664738d5af Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Mon, 8 Jul 2024 14:51:27 +0530 Subject: [PATCH] chore: remove hot reload while theme changing (#20663) --- src/legacy/status_im/events.cljs | 3 +-- src/status_im/contexts/profile/login/events.cljs | 3 +-- src/status_im/contexts/profile/settings/effects.cljs | 9 ++------- src/status_im/contexts/profile/settings/events.cljs | 4 ++-- src/status_im/navigation/events.cljs | 10 ---------- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/legacy/status_im/events.cljs b/src/legacy/status_im/events.cljs index dffe74020a..b49ad3a071 100644 --- a/src/legacy/status_im/events.cljs +++ b/src/legacy/status_im/events.cljs @@ -108,8 +108,7 @@ (when (and (multiaccounts.model/logged-in? db) (= current-theme-type status-im.constants/theme-type-system)) {:profile.settings/switch-theme-fx - [(get-in db [:profile/profile :appearance]) - (:view-id db) true]}))) + [(get-in db [:profile/profile :appearance]) (:view-id db)]}))) (defn- on-biometric-auth-fail [{:keys [code]}] diff --git a/src/status_im/contexts/profile/login/events.cljs b/src/status_im/contexts/profile/login/events.cljs index ac971fd57a..7a04139cb6 100644 --- a/src/status_im/contexts/profile/login/events.cljs +++ b/src/status_im/contexts/profile/login/events.cljs @@ -83,8 +83,7 @@ [[:profile.settings/switch-theme-fx [(or (:appearance settings) constants/theme-type-dark) - :shell-stack - false]] + :shell-stack]] [:dispatch [:init-root :shell-stack]] [:dispatch [:profile/show-testnet-mode-banner-if-enabled]]]))}))) diff --git a/src/status_im/contexts/profile/settings/effects.cljs b/src/status_im/contexts/profile/settings/effects.cljs index 221b7e95af..b31b1e4b66 100644 --- a/src/status_im/contexts/profile/settings/effects.cljs +++ b/src/status_im/contexts/profile/settings/effects.cljs @@ -4,7 +4,6 @@ [react-native.platform :as platform] [status-im.common.theme.core :as theme] [status-im.constants :as constants] - [status-im.setup.hot-reload :as hot-reload] [utils.re-frame :as rf])) (re-frame/reg-fx @@ -20,7 +19,7 @@ (re-frame/reg-fx :profile.settings/switch-theme-fx - (fn [[theme-type view-id reload-ui?]] + (fn [[theme-type view-id]] (let [theme (if (or (= theme-type constants/theme-type-dark) (and (= theme-type constants/theme-type-system) (theme/device-theme-dark?))) @@ -28,8 +27,4 @@ :light)] (theme/set-legacy-theme theme) (rf/dispatch [:theme/switch theme]) - (rf/dispatch [:reload-status-nav-color view-id]) - (when reload-ui? - (re-frame/dispatch [:dismiss-all-overlays]) - (when js/goog.DEBUG - (hot-reload/reload)))))) + (rf/dispatch [:reload-status-nav-color view-id])))) diff --git a/src/status_im/contexts/profile/settings/events.cljs b/src/status_im/contexts/profile/settings/events.cljs index 6126114e72..728041f7b0 100644 --- a/src/status_im/contexts/profile/settings/events.cljs +++ b/src/status_im/contexts/profile/settings/events.cljs @@ -95,14 +95,14 @@ (rf/reg-event-fx :profile.settings/change-appearance (fn [_ [theme]] {:fx [[:dispatch [:profile.settings/profile-update :appearance theme]] - [:profile.settings/switch-theme-fx [theme :appearance true]]]})) + [:profile.settings/switch-theme-fx [theme :appearance]]]})) (rf/reg-event-fx :profile.settings/switch-theme (fn [{:keys [db]} [theme view-id]] (let [theme (or theme (get-in db [:profile/profile :appearance]) constants/theme-type-dark)] - {:fx [[:profile.settings/switch-theme-fx [theme view-id false]]]}))) + {:fx [[:profile.settings/switch-theme-fx [theme view-id]]]}))) (rf/reg-fx :profile.settings/get-profile-picture (fn [key-uid] diff --git a/src/status_im/navigation/events.cljs b/src/status_im/navigation/events.cljs index aae7cfd20d..7ee2049576 100644 --- a/src/status_im/navigation/events.cljs +++ b/src/status_im/navigation/events.cljs @@ -123,16 +123,6 @@ (hide-bottom-sheet new-cofx) {:show-bottom-sheet {:theme theme}})))))) -(rf/defn dismiss-all-overlays - {:events [:dismiss-all-overlays]} - [_] - {:dispatch-n [[:hide-popover] - [:hide-visibility-status-popover] - [:hide-bottom-sheet] - [:bottom-sheet-hidden] - [:bottom-sheet/hide-old-navigation-overlay] - [:toasts/close-all-toasts]]}) - (rf/defn set-view-id {:events [:set-view-id]} [{:keys [db]} view-id]