mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 06:28:47 +00:00
Merge pull request #7154 from penpot/niwinz-staging-bug-1
🐛 Fix incorrect show request-access dialog on not-found on viewer
This commit is contained in:
commit
ed5875f29a
@ -501,16 +501,16 @@
|
|||||||
profile (mf/deref refs/profile)
|
profile (mf/deref refs/profile)
|
||||||
|
|
||||||
auth-error? (= type :authentication)
|
auth-error? (= type :authentication)
|
||||||
|
not-found? (= type :not-found)
|
||||||
|
|
||||||
authenticated?
|
authenticated?
|
||||||
(is-authenticated? profile)
|
(is-authenticated? profile)
|
||||||
|
|
||||||
request-access?
|
request-access?
|
||||||
(and
|
(and
|
||||||
(or (= type :not-found) auth-error?)
|
|
||||||
(or workspace? dashboard? view?)
|
(or workspace? dashboard? view?)
|
||||||
(or (:file-id info)
|
(or (some? (:file-id info))
|
||||||
(:team-id info)))]
|
(some? (:team-id info))))]
|
||||||
|
|
||||||
(mf/with-effect [params info]
|
(mf/with-effect [params info]
|
||||||
(when-not (:loaded info)
|
(when-not (:loaded info)
|
||||||
@ -518,25 +518,26 @@
|
|||||||
(rx/subs! (partial reset! info*)
|
(rx/subs! (partial reset! info*)
|
||||||
(partial reset! info* {:loaded true})))))
|
(partial reset! info* {:loaded true})))))
|
||||||
|
|
||||||
(if (and auth-error? (not authenticated?))
|
|
||||||
[:> context-wrapper*
|
|
||||||
{:is-workspace workspace?
|
|
||||||
:is-dashboard dashboard?
|
|
||||||
:is-viewer view?
|
|
||||||
:profile profile}
|
|
||||||
[:> login-dialog* {}]]
|
|
||||||
|
|
||||||
(when (get info :loaded false)
|
(if (or auth-error? not-found?)
|
||||||
(if request-access?
|
(if (not authenticated?)
|
||||||
[:> context-wrapper* {:is-workspace workspace?
|
[:> context-wrapper*
|
||||||
:is-dashboard dashboard?
|
{:is-workspace workspace?
|
||||||
:is-viewer view?
|
:is-dashboard dashboard?
|
||||||
:profile profile}
|
:is-viewer view?
|
||||||
[:> request-access* {:file-id (:file-id info)
|
:profile profile}
|
||||||
:team-id (:team-id info)
|
[:> login-dialog* {}]]
|
||||||
:is-default (:team-default info)
|
(when (get info :loaded false)
|
||||||
:profile profile
|
(if request-access?
|
||||||
:is-workspace workspace?}]]
|
[:> context-wrapper* {:is-workspace workspace?
|
||||||
|
:is-dashboard dashboard?
|
||||||
[:> exception-section* props])))))
|
:is-viewer view?
|
||||||
|
:profile profile}
|
||||||
|
[:> request-access* {:file-id (:file-id info)
|
||||||
|
:team-id (:team-id info)
|
||||||
|
:is-default (:team-default info)
|
||||||
|
:profile profile
|
||||||
|
:is-workspace workspace?}]]
|
||||||
|
[:> exception-section* props])))
|
||||||
|
|
||||||
|
[:> exception-section* props])))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user