🐛 Fix share button being displayed with no permissions (#6476)

* 🐛 Fix share button being displayed with no permissions

*  Simplify impl by accessing perms from teams directly

---------

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Alonso Torres 2025-05-15 09:49:29 +02:00 committed by GitHub
parent f5f1316f0b
commit ba25ce3098
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -50,6 +50,7 @@
- Fix problem while syncing library colors and typographies [Taiga #11068](https://tree.taiga.io/project/penpot/issue/11068)
- Fix problem with path edition of shapes [Taiga #9496](https://tree.taiga.io/project/penpot/issue/9496)
- Fix exception on paste invalid html [Taiga #11047](https://tree.taiga.io/project/penpot/issue/11047)
- Fix share button being displayed with no permissions [Taiga #11086](https://tree.taiga.io/project/penpot/issue/11086)
## 2.6.2

View file

@ -129,6 +129,12 @@
input-ref (mf/use-ref nil)
team (mf/deref refs/team)
permissions (get team :permissions)
display-share-button?
(and (not (:is-default team))
(or (:is-admin permissions)
(:is-owner permissions)))
nav-to-viewer
(mf/use-fn
@ -216,7 +222,7 @@
:on-click toggle-history}
i/history]])
(when (not (:is-default team))
(when display-share-button?
[:a {:class (stl/css :viewer-btn)
:title (tr "workspace.header.share")
:on-click open-share-dialog}