Fixed info displayed for files with 0 size or with no extension
Этот коммит содержится в:
@@ -5,11 +5,16 @@ import * as Utils from '../utils/utils.jsx';
|
|||||||
|
|
||||||
export default function FileInfoPreview({filename, fileUrl, fileInfo}) {
|
export default function FileInfoPreview({filename, fileUrl, fileInfo}) {
|
||||||
// non-image files include a section providing details about the file
|
// non-image files include a section providing details about the file
|
||||||
let infoString = 'File type ' + fileInfo.extension.toUpperCase();
|
const infoParts = [];
|
||||||
if (fileInfo.size > 0) {
|
|
||||||
infoString += ', Size ' + Utils.fileSizeToString(fileInfo.size);
|
if (fileInfo.extension !== '') {
|
||||||
|
infoParts.push('File type ' + fileInfo.extension.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
infoParts.push('Size ' + Utils.fileSizeToString(fileInfo.size));
|
||||||
|
|
||||||
|
const infoString = infoParts.join(', ');
|
||||||
|
|
||||||
const name = decodeURIComponent(Utils.getFileName(filename));
|
const name = decodeURIComponent(Utils.getFileName(filename));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user