Skip to content

Commit

Permalink
Merge pull request #4257 from nextcloud/backport/4253/stable26
Browse files Browse the repository at this point in the history
[stable26] Don't expect HTML element with ID `mimetype` in public share
  • Loading branch information
mejo- committed Jun 8, 2023
2 parents dc4368c + 166311e commit bc75a56
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
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 bc75a56

Please sign in to comment.