fix jump-to community card animation (#19437)

This commit is contained in:
Parvesh Monu 2024-04-01 16:05:14 +05:30 committed by GitHub
parent 3067b814b1
commit e05d5000b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 12 deletions

View File

@ -304,18 +304,21 @@
(rf/reg-event-fx :communities/navigate-to-community-overview (rf/reg-event-fx :communities/navigate-to-community-overview
(fn [{:keys [db] :as cofx} [deserialized-key]] (fn [{:keys [db] :as cofx} [deserialized-key]]
(if (string/starts-with? deserialized-key constants/serialization-key) (let [current-view-id (:view-id db)]
(navigate-to-serialized-community cofx deserialized-key) (if (string/starts-with? deserialized-key constants/serialization-key)
(rf/merge (navigate-to-serialized-community cofx deserialized-key)
cofx (rf/merge
{:fx [[:dispatch cofx
[:communities/fetch-community {:fx [[:dispatch
{:community-id deserialized-key [:communities/fetch-community
:update-last-opened-at? true}]] {:community-id deserialized-key
[:dispatch [:navigate-to :community-overview deserialized-key]] :update-last-opened-at? true}]]
(when (get-in db [:communities deserialized-key :joined]) [:dispatch [:navigate-to :community-overview deserialized-key]]
[:dispatch [:activity-center.notifications/dismiss-community-overview deserialized-key]])]} (when (get-in db [:communities deserialized-key :joined])
(navigation/pop-to-root :shell-stack))))) [: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 (rf/reg-event-fx :communities/navigate-to-community-chat
(fn [{:keys [db]} [chat-id pop-to-root?]] (fn [{:keys [db]} [chat-id pop-to-root?]]