diff --git a/src/status_im/common/alert_banner/events.cljs b/src/status_im/common/alert_banner/events.cljs index 46e55fd206..a9e6420c13 100644 --- a/src/status_im/common/alert_banner/events.cljs +++ b/src/status_im/common/alert_banner/events.cljs @@ -32,8 +32,16 @@ [{:keys [db]}] {:db (dissoc db :alert-banners/hide?)}) +;; When push notifications are enabled and the app is closed then overlays get dismissed, +;; we need to restore them once app is relaunched +(defn restore-alert-banners + [{:keys [db]}] + (when-not (zero? (count (get db :alert-banners))) + {:show-alert-banner [(:view-id db) (:theme db)]})) + (re-frame/reg-event-fx :alert-banners/add add-alert-banner) (re-frame/reg-event-fx :alert-banners/remove remove-alert-banner) (re-frame/reg-event-fx :alert-banners/remove-all remove-all-alert-banners) (re-frame/reg-event-fx :alert-banners/hide hide-alert-banners) (re-frame/reg-event-fx :alert-banners/unhide unhide-alert-banners) +(re-frame/reg-event-fx :alert-banners/restore-alert-banners restore-alert-banners) diff --git a/src/status_im/navigation/core.cljs b/src/status_im/navigation/core.cljs index bdf8395a82..286b82a9b6 100644 --- a/src/status_im/navigation/core.cljs +++ b/src/status_im/navigation/core.cljs @@ -30,7 +30,8 @@ (when @state/root-id (reset! theme/device-theme (rn/get-color-scheme)) (re-frame/dispatch [:init-root @state/root-id]) - (re-frame/dispatch [:chat/check-last-chat])) + (re-frame/dispatch [:chat/check-last-chat]) + (re-frame/dispatch [:alert-banners/restore-alert-banners])) (rn/hide-splash-screen))) ;;;; Modal