mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 19:22:18 +02:00
Merge pull request #5885 from penpot/niwinz-bugfix-5
🐛 Fix regression on request-access dialog
This commit is contained in:
commit
51202df105
1 changed files with 12 additions and 13 deletions
|
@ -463,14 +463,13 @@
|
||||||
(let [type (:type data)
|
(let [type (:type data)
|
||||||
path (:path route)
|
path (:path route)
|
||||||
|
|
||||||
query-params (:query-params route)
|
params (:query-params route)
|
||||||
path-params (:path-params route)
|
|
||||||
|
|
||||||
workspace? (str/includes? path "workspace")
|
workspace? (str/includes? path "workspace")
|
||||||
dashboard? (str/includes? path "dashboard")
|
dashboard? (str/includes? path "dashboard")
|
||||||
view? (str/includes? path "view")
|
view? (str/includes? path "view")
|
||||||
|
|
||||||
;; We stora the request access info int this state
|
;; We store the request access info int this state
|
||||||
info* (mf/use-state nil)
|
info* (mf/use-state nil)
|
||||||
info (deref info*)
|
info (deref info*)
|
||||||
|
|
||||||
|
@ -478,22 +477,22 @@
|
||||||
|
|
||||||
request-access?
|
request-access?
|
||||||
(and
|
(and
|
||||||
(or (= (:type data) :not-found) (= (:type data) :authentication))
|
(or (= (:type data) :not-found)
|
||||||
|
(= (:type data) :authentication))
|
||||||
(or workspace? dashboard? view?)
|
(or workspace? dashboard? view?)
|
||||||
(or (:file-id info)
|
(or (:file-id info)
|
||||||
(:team-id info)))]
|
(:team-id info)))]
|
||||||
|
|
||||||
(mf/with-effect [type path query-params path-params]
|
(mf/with-effect [type path params]
|
||||||
(let [query-params (u/map->query-string query-params)
|
(st/emit! (ptk/data-event ::ev/event
|
||||||
event-params {::ev/name "exception-page"
|
{::ev/name "exception-page"
|
||||||
:type type
|
:type type
|
||||||
:path path
|
:path path
|
||||||
:query-params query-params}]
|
:params (u/map->query-string params)})))
|
||||||
(st/emit! (ptk/event ::ev/event event-params))))
|
|
||||||
|
|
||||||
(mf/with-effect [path-params info]
|
(mf/with-effect [params info]
|
||||||
(when-not (:loaded info)
|
(when-not (:loaded info)
|
||||||
(->> (load-info path-params)
|
(->> (load-info params)
|
||||||
(rx/subs! (partial reset! info*)))))
|
(rx/subs! (partial reset! info*)))))
|
||||||
|
|
||||||
(when loaded?
|
(when loaded?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue