🐛 Fix redirect after leaving team

This commit is contained in:
Elena Torro 2026-05-19 10:35:14 +02:00 committed by Alonso Torres
parent ee6489b202
commit 29ad9aa057
2 changed files with 11 additions and 2 deletions

View File

@ -82,7 +82,15 @@
(watch [_ state _]
(when-let [team-id (or team-id (:current-team-id state))]
(->> (rp/cmd! :get-team-members {:team-id team-id})
(rx/map (partial members-fetched team-id))))))))
(rx/map (partial members-fetched team-id))
(rx/catch (fn [cause]
(let [{:keys [type]} (ex-data cause)]
(if (= :not-found type)
(do
(log/warn :hint "fetch-members: team not found, skipping"
:team-id (str team-id))
(rx/empty))
(rx/throw cause)))))))))))
(defn- invitations-fetched
[team-id invitations]

View File

@ -229,7 +229,8 @@
(mf/deps profile)
(fn []
(let [team-id (:default-team-id profile)]
(st/emit! (dcm/go-to-dashboard-recent :team-id team-id)))))
(st/emit! (rt/assign-exception nil)
(dcm/go-to-dashboard-recent :team-id team-id)))))
on-success
(mf/use-fn