diff --git a/src/components/views/dialogs/UploadConfirmDialog.tsx b/src/components/views/dialogs/UploadConfirmDialog.tsx index 612903a6ee..0b6c4d0add 100644 --- a/src/components/views/dialogs/UploadConfirmDialog.tsx +++ b/src/components/views/dialogs/UploadConfirmDialog.tsx @@ -33,8 +33,8 @@ interface IProps { @replaceableComponent("views.dialogs.UploadConfirmDialog") export default class UploadConfirmDialog extends React.Component { - private objectUrl: string; - private mimeType: string; + private readonly objectUrl: string; + private readonly mimeType: string; static defaultProps = { totalFiles: 1, @@ -69,7 +69,7 @@ export default class UploadConfirmDialog extends React.Component { }; render() { - let title; + let title: string; if (this.props.totalFiles > 1 && this.props.currentIndex !== undefined) { title = _t( "Upload files (%(current)s of %(total)s)", @@ -82,23 +82,23 @@ export default class UploadConfirmDialog extends React.Component { title = _t('Upload files'); } - let preview; - if (this.mimeType.startsWith('image/')) { - preview =
-
-
-
{ this.props.file.name } ({ filesize(this.props.file.size) })
-
-
; + let preview: JSX.Element; + let placeholder: JSX.Element; + if (this.mimeType.startsWith("image/")) { + preview = ( + + ); + } else if (this.mimeType.startsWith("video/")) { + preview = ( +