mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
fix: element visible race condition (#1996)
On larger documents we could accidentally start trying to render fields while not all pages of the PDF have loaded due to us checking for a single page existing. This would cause an error to be thrown, hard locking those documents. This change resolves this by grabbing the highest page number from the given fields and using it for the visibility check instead.
This commit is contained in:
@ -67,6 +67,7 @@ export async function loader({ params, request }: Route.LoaderArgs) {
|
||||
const documentVisibility = document?.visibility;
|
||||
const currentTeamMemberRole = team.currentTeamRole;
|
||||
const isRecipient = document?.recipients.find((recipient) => recipient.email === user.email);
|
||||
|
||||
let canAccessDocument = true;
|
||||
|
||||
if (!isRecipient && document?.userId !== user.id) {
|
||||
|
||||
Reference in New Issue
Block a user