🐛 Keep organizations visible without Personal Projects

This commit is contained in:
Marina López 2026-09-28 11:11:19 +02:00
parent 05bd19787c
commit 59d8dcac4c
2 changed files with 14 additions and 5 deletions

View File

@ -842,3 +842,16 @@
(defn team->organization [team]
(when-let [organization (:organization team)]
(assoc organization :default-team-id (:id team))))
(defn teams->organizations
"Returns organizations indexed by id, preferring default teams as navigation targets."
[teams]
(let [teams (vals teams)]
(merge
(->> teams
(keep team->organization)
(d/index-by :id))
(->> teams
(filter :is-default)
(map team->organization)
(d/index-by :id)))))

View File

@ -731,11 +731,7 @@
;; show the current selection without leaking the team into the
;; teams dropdown.
organizations (mf/with-memo [teams current-organization]
(cond-> (->> teams
vals
(filter :is-default)
(map dtm/team->organization)
(d/index-by :id))
(cond-> (dtm/teams->organizations teams)
(:id current-organization)
(assoc (:id current-organization) current-organization)))