From 6d65071ecd1b024e0872c50749bde46b6c53b683 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Fri, 24 Jul 2015 11:16:22 -0400
Subject: Removed unused imgCount property from ViewImageModal

---
 web/react/components/view_image.jsx | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

(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 7b096c629..6ba76c0f8 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -31,18 +31,13 @@ module.exports = React.createClass({
             return;
         };
 
-        var src = "";
-        if (this.props.imgCount > 0) {
-            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 = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
-            src = fileInfo['path'] + '_preview.jpg';
+        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 = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
+        var src = fileInfo['path'] + '_preview.jpg';
 
         var self = this;
         var img = new Image();
@@ -141,16 +136,13 @@ module.exports = React.createClass({
             for (var id in this.state.images) {
                 var info = utils.splitFileLocation(this.props.filenames[id]);
                 var preview_filename = "";
-                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 = utils.getWindowLocationOrigin() + "/api/v1/files/get" + info.path;
-                    preview_filename = info['path'] + '_preview.jpg';
+
+                // 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 = utils.getWindowLocationOrigin() + "/api/v1/files/get" + info.path;
+                preview_filename = info['path'] + '_preview.jpg';
 
                 var imgClass = "hidden";
                 if (this.state.loaded[id] && this.state.imgId == id) imgClass = "";
-- 
cgit v1.2.3-1-g7c22

