summaryrefslogtreecommitdiffstats
path: root/web/react/components/view_image.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-21 16:54:24 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-21 16:54:24 -0400
commit1c08a33b92f72d77d6c5f1fce916e2cd7c655ff0 (patch)
tree3217cf6a99db6e07a7d5b90142033f05e8e70ea7 /web/react/components/view_image.jsx
parentf5837c1b64994a15537a0b8df109bed504d0d20a (diff)
downloadchat-1c08a33b92f72d77d6c5f1fce916e2cd7c655ff0.tar.gz
chat-1c08a33b92f72d77d6c5f1fce916e2cd7c655ff0.tar.bz2
chat-1c08a33b92f72d77d6c5f1fce916e2cd7c655ff0.zip
Fixing file uploads and previews for new /team/ URL structure
Diffstat (limited to 'web/react/components/view_image.jsx')
-rw-r--r--web/react/components/view_image.jsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index 2274f3f2e..4675269d5 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -36,6 +36,11 @@ module.exports = React.createClass({
src = this.props.filenames[id];
} else {
var fileInfo = utils.splitFileLocation(this.props.filenames[id]);
+ // This is a temporary patch to fix issue with old files using absolute paths
+ if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
+ fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
+ }
+ fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
src = fileInfo['path'] + '_preview.jpg';
}