♻️ Clean up and refactors of viewer role

This commit is contained in:
Pablo Alba 2024-10-17 16:47:55 +02:00
parent 66530ca868
commit bd08e99080
11 changed files with 53 additions and 60 deletions

View file

@ -7,6 +7,7 @@
(ns app.main.ui.dashboard.projects
(:require-macros [app.main.style :as stl])
(:require
[app.common.data.macros :as dm]
[app.common.geom.point :as gpt]
[app.main.data.dashboard :as dd]
[app.main.data.events :as ev]
@ -312,9 +313,9 @@
(sort-by :modified-at)
(reverse))
recent-map (mf/deref recent-files-ref)
you-owner? (get-in team [:permissions :is-owner])
you-admin? (get-in team [:permissions :is-admin])
you-viewer? (not (get-in team [:permissions :can-edit]))
you-owner? (dm/get-in team [:permissions :is-owner])
you-admin? (dm/get-in team [:permissions :is-admin])
you-viewer? (not (dm/get-in team [:permissions :can-edit]))
can-invite? (or you-owner? you-admin?)
show-team-hero* (mf/use-state #(get storage/global ::show-team-hero true))