Skip to content

Commit

Permalink
fix(sharing): Don't ask for guest name on view-only share
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <[email protected]>
  • Loading branch information
elzody authored and juliushaertl committed Sep 19, 2024
1 parent 4920f50 commit 046baa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cypress/e2e/share-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ describe('Public sharing of office documents', function() {
},
})

cy.inputCollaboraGuestName(guestName)
// Assert that we do not ask for guest name on readonly document
cy.get('[data-cy="guestNameModal"]').should('not.exist')

cy.waitForCollabora()
cy.waitForPostMessage('App_LoadingStatus', { Status: 'Document_Loaded' })

Expand Down
4 changes: 4 additions & 0 deletions src/helpers/guestName.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ export function shouldAskForGuestName(mimetype, canWrite) {
const noCurrentUser = !getCurrentUser() || getCurrentUser()?.uid === ''
const isReadOnlyPDF = mimetype === 'application/pdf' && !canWrite

if (!canWrite) {
return false
}

return noLoggedInUser && noGuest && noCurrentUser && !isReadOnlyPDF
}

0 comments on commit 046baa7

Please sign in to comment.