Refresh members after accept team request access

This commit is contained in:
Andrey Antukh 2024-11-12 16:39:15 +01:00
parent 6eadea8485
commit 4f4ef6f1f2
7 changed files with 55 additions and 51 deletions

View file

@ -192,8 +192,8 @@
(mf/deps project-id (:id team))
(fn []
(st/emit! (dd/fetch-files {:project-id project-id})
(dd/fetch-recent-files (:id team))
(dd/fetch-projects (:id team))
(dd/fetch-recent-files)
(dd/fetch-projects)
(dd/clear-selected-files))))
handle-create-click
@ -303,17 +303,17 @@
[:span {:class (stl/css :placeholder-label)} (tr "dashboard.show-all-files")]
show-more-icon])]))
(def recent-files-ref
(def ref:recent-files
(l/derived :dashboard-recent-files st/state))
(mf/defc projects-section
[{:keys [team projects profile] :as props}]
{::mf/props :obj}
[{:keys [team projects profile]}]
(let [projects (->> (vals projects)
(sort-by :modified-at)
(reverse))
recent-map (mf/deref recent-files-ref)
recent-map (mf/deref ref:recent-files)
permisions (:permissions team)
can-edit (:can-edit permisions)
@ -326,8 +326,6 @@
is-my-penpot (= (:default-team-id profile) (:id team))
is-defalt-team? (:is-default team)
team-id (:id team)
on-close
(mf/use-fn
(fn []
@ -344,8 +342,8 @@
(:name team))]
(dom/set-html-title (tr "title.dashboard.projects" tname))))
(mf/with-effect [team-id]
(st/emit! (dd/fetch-recent-files team-id)
(mf/with-effect []
(st/emit! (dd/fetch-recent-files)
(dd/clear-selected-files)))
(when (seq projects)