diff options
author | =Corey Hulen <corey@hulen.com> | 2015-07-22 18:05:44 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-07-22 18:05:44 -0800 |
commit | c277a98b5d88c81df39f8e33ef1286f72ac04014 (patch) | |
tree | 0d96238a2ee3ab121ea576db9900311ff5a57ba6 /web/react/components/post_body.jsx | |
parent | e0bad6c03784d44210760577550be585daf513b9 (diff) | |
parent | f4c3eaa8c091366a956fa2ab48124190f4f9082b (diff) | |
download | chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.tar.gz chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.tar.bz2 chat-c277a98b5d88c81df39f8e33ef1286f72ac04014.zip |
Merge branch 'master' into mm-1420
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r-- | web/react/components/post_body.jsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index d9678df30..7871f52b7 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -28,6 +28,12 @@ module.exports = React.createClass({ var type = utils.getFileType(fileInfo.ext); + // 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; + if (type === "image") { $('<img/>').attr('src', fileInfo.path+'_thumb.jpg').load(function(path, name){ return function() { $(this).remove(); @@ -102,6 +108,12 @@ module.exports = React.createClass({ var type = utils.getFileType(fileInfo.ext); + // 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; + if (type === "image") { if (i < Constants.MAX_DISPLAY_FILES) { postFiles.push( |