mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
🐛 Keep organizations visible without Personal Projects
This commit is contained in:
parent
05bd19787c
commit
59d8dcac4c
@ -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)))))
|
||||
|
||||
@ -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)))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user