Skip to content

Commit 2b4bd39

Browse files
authored
Merge pull request #4253 from nextcloud/fix/public_share_auth
Don't expect HTML element with ID `mimetype` in public share
2 parents 4a7b4af + 09845de commit 2b4bd39

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

js/text-public.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-public.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const loadEditor = ({ sharingToken, mimetype, fileId, $el }) => {
4949
}
5050

5151
documentReady(() => {
52-
const mimetype = document.getElementById('mimetype').value
5352
const sharingToken = document.getElementById('sharingToken') ? document.getElementById('sharingToken').value : null
5453

5554
if (!sharingToken) {
@@ -67,7 +66,8 @@ documentReady(() => {
6766
}
6867

6968
// single file share
70-
if (openMimetypes.indexOf(mimetype) !== -1) {
69+
const mimetype = document.getElementById('mimetype')?.value
70+
if (mimetype && openMimetypes.indexOf(mimetype) !== -1) {
7171
const $el = document.getElementById('preview')
7272
const fileId = loadState('text', 'file_id')
7373
loadEditor({ mimetype, sharingToken, fileId, $el })

0 commit comments

Comments
 (0)