diff options
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r-- | webapp/utils/utils.jsx | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 25a9dfa7d..5a47b0a63 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -413,8 +413,8 @@ export function getFileType(extin) { return 'other'; } -export function getPreviewImagePathForFileType(fileTypeIn) { - var fileType = fileTypeIn.toLowerCase(); +export function getFileIconPath(fileInfo) { + const fileType = getFileType(fileInfo.extension); var icon; if (fileType in Constants.ICON_FROM_TYPE) { @@ -451,19 +451,6 @@ export function splitFileLocation(fileLocation) { return {ext, name: filename, path: filePath}; } -export function getPreviewImagePath(filename) { - // Returns the path to a preview image that can be used to represent a file. - const fileInfo = splitFileLocation(filename); - const fileType = getFileType(fileInfo.ext); - - if (fileType === 'image') { - return getFileUrl(fileInfo.path + '_preview.jpg'); - } - - // only images have proper previews, so just use a placeholder icon for non-images - return getPreviewImagePathForFileType(fileType); -} - export function toTitleCase(str) { function doTitleCase(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); |