summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-21 18:50:01 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-21 18:50:01 -0400
commit06bac01e882a7b05519d0e39bccafacd0c27c602 (patch)
tree94ea89f0b20e287d2de3b002ffc037c72c85f0ae /web
parent26010e2690c251ef1424d7ad4037efbff5ac8901 (diff)
parent2d51e93d8e2b455fc325ab10c0b13fa9a497bb9a (diff)
downloadchat-06bac01e882a7b05519d0e39bccafacd0c27c602.tar.gz
chat-06bac01e882a7b05519d0e39bccafacd0c27c602.tar.bz2
chat-06bac01e882a7b05519d0e39bccafacd0c27c602.zip
Merge pull request #227 from mattermost/files-patch
Fixing image previews.
Diffstat (limited to 'web')
-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 4675269d5..4d5d54e7f 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -144,6 +144,11 @@ module.exports = React.createClass({
if (this.props.imgCount > 0) {
preview_filename = this.props.filenames[this.state.imgId];
} else {
+ // This is a temporary patch to fix issue with old files using absolute paths
+ if (info.path.indexOf("/api/v1/files/get") != -1) {
+ info.path = info.path.split("/api/v1/files/get")[1];
+ }
+ info.path = window.location.origin + "/api/v1/files/get" + info.path;
preview_filename = info['path'] + '_preview.jpg';
}