diff --git a/src/status_im/contexts/communities/events.cljs b/src/status_im/contexts/communities/events.cljs index 1a0b8aedd5..c9020ff410 100644 --- a/src/status_im/contexts/communities/events.cljs +++ b/src/status_im/contexts/communities/events.cljs @@ -304,18 +304,21 @@ (rf/reg-event-fx :communities/navigate-to-community-overview (fn [{:keys [db] :as cofx} [deserialized-key]] - (if (string/starts-with? deserialized-key constants/serialization-key) - (navigate-to-serialized-community cofx deserialized-key) - (rf/merge - cofx - {:fx [[:dispatch - [:communities/fetch-community - {:community-id deserialized-key - :update-last-opened-at? true}]] - [:dispatch [:navigate-to :community-overview deserialized-key]] - (when (get-in db [:communities deserialized-key :joined]) - [:dispatch [:activity-center.notifications/dismiss-community-overview deserialized-key]])]} - (navigation/pop-to-root :shell-stack))))) + (let [current-view-id (:view-id db)] + (if (string/starts-with? deserialized-key constants/serialization-key) + (navigate-to-serialized-community cofx deserialized-key) + (rf/merge + cofx + {:fx [[:dispatch + [:communities/fetch-community + {:community-id deserialized-key + :update-last-opened-at? true}]] + [:dispatch [:navigate-to :community-overview deserialized-key]] + (when (get-in db [:communities deserialized-key :joined]) + [:dispatch + [:activity-center.notifications/dismiss-community-overview deserialized-key]])]} + (when-not (or (= current-view-id :shell) (= current-view-id :communities-stack)) + (navigation/pop-to-root :shell-stack))))))) (rf/reg-event-fx :communities/navigate-to-community-chat (fn [{:keys [db]} [chat-id pop-to-root?]]