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:
Alejandro Alonso 2025-08-22 09:19:47 +02:00 committed by GitHub
commit ed5875f29a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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])))