Skip to content

Commit b62c494

Browse files
Parveshdhullalwx
authored andcommitted
fix status-bar font color (#15596)
1 parent 81d4799 commit b62c494

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

src/status_im/multiaccounts/login/core.cljs

+21-18
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,25 @@
365365
[_]
366366
(status/get-node-config #(re-frame/dispatch [::get-node-config-callback %])))
367367

368+
(rf/defn redirect-to-root
369+
"Decides which root should be initialised depending on user and app state"
370+
[{:keys [db] :as cofx}]
371+
(cond
372+
(get db :onboarding-2/new-account?)
373+
{:dispatch [:onboarding-2/finalize-setup]}
374+
375+
(get db :tos/accepted?)
376+
(rf/merge
377+
cofx
378+
(multiaccounts/switch-theme nil :shell-stack)
379+
(navigation/init-root :shell-stack))
380+
381+
:else
382+
{:dispatch [:init-root :tos]}))
383+
368384
(rf/defn get-settings-callback
369385
{:events [::get-settings-callback]}
370-
[{:keys [db] :as cofx} settings]
386+
[{:keys [db] :as cofx} settings pairing-in-progress?]
371387
(let [{:networks/keys [current-network networks]
372388
:as settings}
373389
(data-store.settings/rpc->settings settings)
@@ -397,7 +413,9 @@
397413
(logging/set-log-level (:log-level multiaccount))
398414
(activity-center/notifications-fetch-pending-contact-requests)
399415
(activity-center/update-seen-state)
400-
(activity-center/notifications-fetch-unread-count))))
416+
(activity-center/notifications-fetch-unread-count)
417+
(when-not pairing-in-progress?
418+
(redirect-to-root)))))
401419

402420
(re-frame/reg-fx
403421
::open-last-chat
@@ -472,19 +490,6 @@
472490
keychain/auth-method-biometric
473491
keychain/auth-method-password))))
474492

475-
(defn redirect-to-root
476-
"Decides which root should be initialised depending on user and app state"
477-
[db]
478-
(cond
479-
(get db :onboarding-2/new-account?)
480-
(re-frame/dispatch [:onboarding-2/finalize-setup])
481-
482-
(get db :tos/accepted?)
483-
(re-frame/dispatch [:init-root :shell-stack])
484-
485-
:else
486-
(re-frame/dispatch [:init-root :tos])))
487-
488493
(rf/defn login-only-events
489494
[{:keys [db] :as cofx} key-uid password save-password?]
490495
(let [auth-method (:auth-method db)
@@ -497,9 +502,7 @@
497502
{:db (assoc db :chats/loading? true)
498503
:json-rpc/call
499504
[{:method "settings_getSettings"
500-
:on-success #(do (re-frame/dispatch [::get-settings-callback %])
501-
(when-not pairing-in-progress?
502-
(redirect-to-root db)))}]}
505+
:on-success #(re-frame/dispatch [::get-settings-callback % pairing-in-progress?])}]}
503506
(notifications/load-notification-preferences)
504507
(when save-password?
505508
(keychain/save-user-password key-uid password))

src/status_im2/navigation/options.cljs

+9-5
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@
77
{:layout {:orientation :portrait}
88
:topBar {:visible false}})
99

10+
;; Note: Currently, the status bar style provided while setting the root has a high preference,
11+
;; and even if we change the status bar style later dynamically, the style gets restored to this
12+
;; set root style while navigating
13+
;; https://github.com/status-im/status-mobile/pull/15596
1014
(defn statusbar-and-navbar-root
11-
[]
15+
[& [status-bar-theme]]
1216
(if platform/android?
1317
{:navigationBar {:backgroundColor colors/neutral-100}
1418
:statusBar {:translucent true
1519
:backgroundColor :transparent
16-
:style :light
20+
:style (or status-bar-theme :light)
1721
:drawBehind true}}
18-
{:statusBar {:style :light}}))
22+
{:statusBar {:style (or status-bar-theme :light)}}))
1923

2024
(defn default-root
21-
[]
22-
(merge (statusbar-and-navbar-root)
25+
[& [status-bar-theme]]
26+
(merge (statusbar-and-navbar-root status-bar-theme)
2327
{:topBar {:visible false}
2428
:layout {:componentBackgroundColor (colors/theme-colors colors/white colors/neutral-100)
2529
:orientation :portrait

src/status_im2/navigation/roots.cljs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(ns status-im2.navigation.roots
22
(:require [status-im2.navigation.view :as views]
3+
[quo2.foundations.colors :as colors]
34
[status-im2.navigation.options :as options]
45
[status-im2.constants :as constants]))
56

@@ -101,7 +102,8 @@
101102
{:stack {:id :shell-stack
102103
:children [{:component {:name :shell-stack
103104
:id :shell-stack
104-
:options (options/default-root)}}]}}}
105+
:options (options/default-root
106+
(if (colors/dark?) :light :dark))}}]}}}
105107
:profiles
106108
{:root
107109
{:stack {:id :profiles

0 commit comments

Comments
 (0)