Compare commits

...
Author SHA1 Message Date
Alexander fddaf79791 Merge branch 'develop' into alert-banner-disabled 2024-04-23 15:03:24 +02:00
Alexander 3ab012fe51 Merge branch 'develop' into alert-banner-disabled 2024-04-23 12:17:19 +02:00
alwx 76d2d65858 Fixes 2024-04-23 12:16:32 +02:00
alwx e8f98e76aa Disabling Testnet alert banner 2024-04-23 12:00:28 +02:00
3 changed files with 12 additions and 6 deletions
@@ -45,6 +45,9 @@
error-banner (:error banners)
safe-area-top (safe-area/get-top)
colors-map (get-colors-map theme)]
;; WARNING: alert banner is buggy and shouldn't be used, because it causes multiple issues with
;; composer, chat top bar, performance monitor, sheets, etc etc. See more details here:
;; https://github.com/status-im/status-mobile/issues/19506
[hole-view/hole-view
;; required for fix flicker issue https://github.com/status-im/status-mobile/issues/19490
{:style {:padding-bottom 1}
@@ -57,7 +57,7 @@
[quo/button
{:on-press (fn []
(rf/dispatch [:init-root :shell-stack])
(rf/dispatch [:profile/show-testnet-mode-banner-if-enabled])
(rf/dispatch [:profile/show-testnet-mode-alert-if-enabled])
(rf/dispatch [:universal-links/process-stored-event]))
:type :primary
:accessibility-label :welcome-button
@@ -81,7 +81,7 @@
:shell-stack
false]]
[:set-root :shell-stack]
[:dispatch [:profile/show-testnet-mode-banner-if-enabled]]]))})))
[:dispatch [:profile/show-testnet-mode-alert-if-enabled]]]))})))
;; login phase 2: we want to load and show chats faster, so we split login into 2 phases
(rf/reg-event-fx :profile.login/get-chats-callback
@@ -229,10 +229,13 @@
{:db (update db :profile/login assoc :password password :error error)}))
(rf/reg-event-fx
:profile/show-testnet-mode-banner-if-enabled
:profile/show-testnet-mode-alert-if-enabled
(fn [{:keys [db]}]
(when (get-in db [:profile/profile :test-networks-enabled?])
{:fx [[:dispatch
[:alert-banners/add
{:type :alert
:text (i18n/label :t/testnet-mode-enabled)}]]]})))
[:toasts/upsert
{:type :negative
:theme :dark
:text (i18n/label :t/testnet-mode-enabled)
:duration 100000}]]]})))