diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-07-28 11:14:16 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-07-28 11:14:16 -0400 |
commit | 2602f3b49edd92cc292a49cca26377f19f1ccf4b (patch) | |
tree | 2785d6eb37fa6eb039611d3ec6c43c998ba8ee8d /web/react/utils/utils.jsx | |
parent | ec2e61bc55aa12c4157937ed6492e109ad3422ae (diff) | |
parent | 892fe2b7b6b801e31dd23d74be14d68c989a4d12 (diff) | |
download | chat-2602f3b49edd92cc292a49cca26377f19f1ccf4b.tar.gz chat-2602f3b49edd92cc292a49cca26377f19f1ccf4b.tar.bz2 chat-2602f3b49edd92cc292a49cca26377f19f1ccf4b.zip |
Merge pull request #255 from hmhealey/mm1682
MM-1682 Allow files without file extensions to be attached to messages
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 00580af6e..fbf1e0d4f 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -546,10 +546,13 @@ module.exports.getIconClassName = function(fileType) { module.exports.splitFileLocation = function(fileLocation) { var fileSplit = fileLocation.split('.'); - if (fileSplit.length < 2) return {}; - var ext = fileSplit[fileSplit.length-1]; - fileSplit.splice(fileSplit.length-1,1) + var ext = ""; + if (fileSplit.length > 1) { + ext = fileSplit[fileSplit.length - 1]; + fileSplit.splice(fileSplit.length - 1, 1); + } + var filePath = fileSplit.join('.'); var filename = filePath.split('/')[filePath.split('/').length-1]; |