From 1c08a33b92f72d77d6c5f1fce916e2cd7c655ff0 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 21 Jul 2015 16:54:24 -0400 Subject: Fixing file uploads and previews for new /team/ URL structure --- web/react/components/view_image.jsx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/react/components/view_image.jsx') 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'; } -- cgit v1.2.3-1-g7c22