diff --git a/src/status_im/contexts/chat/events.cljs b/src/status_im/contexts/chat/events.cljs index 1b15535c8b68..f1f444aaef14 100644 --- a/src/status_im/contexts/chat/events.cljs +++ b/src/status_im/contexts/chat/events.cljs @@ -214,8 +214,9 @@ [cofx chat-id animation] (rf/merge cofx - (navigation/pop-to-root :shell-stack) - (navigate-to-chat chat-id animation))) + {:dispatch-later {:ms 500 + :dispatch [:chat/navigate-to-chat chat-id animation]}} + (navigation/pop-to-root :shell-stack))) (rf/defn handle-clear-history-response {:events [:chat/history-cleared]} diff --git a/src/status_im/contexts/communities/events.cljs b/src/status_im/contexts/communities/events.cljs index e496197c83d5..83fe2b414b59 100644 --- a/src/status_im/contexts/communities/events.cljs +++ b/src/status_im/contexts/communities/events.cljs @@ -375,7 +375,7 @@ [:dispatch [:chat/navigate-to-chat chat-id (when-not (ff/enabled? ::ff/shell.jump-to) - transitions/stack-slide-animation)]])]} + transitions/stack-slide-transition)]])]} (when-not (get-in db [:chats chat-id :community-id]) {:db (assoc-in db [:chats chat-id :community-id] community-id)})))) diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index c6782ec1d2b7..708d5b51b582 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -129,7 +129,8 @@ :component shell-qr-reader/view} {:name :chat - :options {:popGesture false} + :options {:popGesture false + :animations transitions/stack-transition-from-bottom} :component chat/chat} {:name :start-a-new-chat @@ -211,6 +212,7 @@ :component communities.discover/view} {:name :community-overview + :options {:animations transitions/stack-transition-from-bottom} :component communities.overview/view} {:name :settings diff --git a/src/status_im/navigation/state.cljs b/src/status_im/navigation/state.cljs index 191a07ceb48c..e80bbc79df42 100644 --- a/src/status_im/navigation/state.cljs +++ b/src/status_im/navigation/state.cljs @@ -19,8 +19,10 @@ (defn navigation-state-push [component] - (swap! navigation-state conj component) - (update-view-id)) + (when-let [view-id (:id (last (get-navigation-state)))] + (when-not (= view-id (:id component)) + (swap! navigation-state conj component) + (update-view-id)))) (defn navigation-state-pop [] diff --git a/src/status_im/navigation/transitions.cljs b/src/status_im/navigation/transitions.cljs index a402a777acd9..af79ce4194b1 100644 --- a/src/status_im/navigation/transitions.cljs +++ b/src/status_im/navigation/transitions.cljs @@ -41,10 +41,18 @@ :duration constants/onboarding-modal-animation-duration}}}) ;;;; Stack Transitions -(def stack-slide-animation +(def stack-slide-transition {:push {:content {:translationX {:from (:width (rn/get-window)) :to 0 :duration 200}}} :pop {:content {:translationX {:from 0 :to (:width (rn/get-window)) :duration 200}}}}) + +(def stack-transition-from-bottom + {:push {:content {:translationY {:from (:height (rn/get-window)) + :to 0 + :duration 200}}} + :pop {:content {:translationY {:from 0 + :to (:height (rn/get-window)) + :duration 200}}}})