fix: src/js/file.js

This commit is contained in:
Bobby 2022-06-28 13:36:17 +07:00
parent 4f2cf3123b
commit 7c4206a4e2
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -171,7 +171,7 @@ page.loadFileinfo = () => {
img.setAttribute('alt', page.file.name || '') img.setAttribute('alt', page.file.name || '')
img.src = `${page.uploadRoot}/${page.file.name}` img.src = `${page.uploadRoot}/${page.file.name}`
img.parentNode.classList.remove('is-hidden') img.parentNode.classList.remove('is-hidden')
img.onerror = event => event.currentTarget.classList.add('is-hidden') img.onerror = event => event.currentTarget.parentNode.classList.add('is-hidden')
const isvideo = page.file.type.startsWith('video/') const isvideo = page.file.type.startsWith('video/')
const isaudio = page.file.type.startsWith('audio/') const isaudio = page.file.type.startsWith('audio/')