diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-07-21 17:49:08 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-07-21 18:06:30 -0400 |
commit | 73ee387319d59dca073e4cd0c1b9b60b392b137d (patch) | |
tree | 5f03802e4beca63ae3b175bab20e50e3afd2d956 /web/react | |
parent | 1c08a33b92f72d77d6c5f1fce916e2cd7c655ff0 (diff) | |
download | chat-73ee387319d59dca073e4cd0c1b9b60b392b137d.tar.gz chat-73ee387319d59dca073e4cd0c1b9b60b392b137d.tar.bz2 chat-73ee387319d59dca073e4cd0c1b9b60b392b137d.zip |
Fixing issues with files trasitioning to relative paths
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/file_preview.jsx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/web/react/components/file_preview.jsx b/web/react/components/file_preview.jsx index 553293d2b..e69607206 100644 --- a/web/react/components/file_preview.jsx +++ b/web/react/components/file_preview.jsx @@ -19,6 +19,10 @@ module.exports = React.createClass({ var filenameSplit = filename.split('.'); var ext = filenameSplit[filenameSplit.length-1]; var type = utils.getFileType(ext); + // This is a temporary patch to fix issue with old files using absolute paths + if (filename.indexOf("/api/v1/files/get") != -1) { + filename = filename.split("/api/v1/files/get")[1]; + } filename = window.location.origin + "/api/v1/files/get" + filename; if (type === "image") { |