Skip to content

Commit

Permalink
Merge pull request #4256 from nextcloud/backport/4253/stable27
Browse files Browse the repository at this point in the history
[stable27] Don't expect HTML element with ID `mimetype` in public share
  • Loading branch information
mejo- authored Jun 19, 2023
2 parents 2673eeb + 75e950d commit fd50c15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const loadEditor = ({ sharingToken, mimetype, fileId, $el }) => {
}

documentReady(() => {
const mimetype = document.getElementById('mimetype').value
const sharingToken = document.getElementById('sharingToken') ? document.getElementById('sharingToken').value : null

if (!sharingToken) {
Expand All @@ -67,7 +66,8 @@ documentReady(() => {
}

// single file share
if (openMimetypes.indexOf(mimetype) !== -1) {
const mimetype = document.getElementById('mimetype')?.value
if (mimetype && openMimetypes.indexOf(mimetype) !== -1) {
const $el = document.getElementById('preview')
const fileId = loadState('text', 'file_id')
loadEditor({ mimetype, sharingToken, fileId, $el })
Expand Down

0 comments on commit fd50c15

Please sign in to comment.