From c130d3630bb2b00d250bf7769792654e2ffda901 Mon Sep 17 00:00:00 2001
From: Saturnino Abril <saturnino.abril@gmail.com>
Date: Mon, 31 Jul 2017 23:36:46 +0800
Subject: prevent ViewImageModal to re-render when file count is unchanged
 (#7048)

---
 webapp/components/view_image.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'webapp/components/view_image.jsx')

diff --git a/webapp/components/view_image.jsx b/webapp/components/view_image.jsx
index 04ace6c55..237d0a6dc 100644
--- a/webapp/components/view_image.jsx
+++ b/webapp/components/view_image.jsx
@@ -100,7 +100,7 @@ export default class ViewImageModal extends React.Component {
             this.onModalHidden();
         }
 
-        if (this.props.fileInfos !== nextProps.fileInfos) {
+        if (this.props.fileInfos.length !== nextProps.fileInfos.length) {
             this.setState({
                 loaded: Utils.fillArray(false, nextProps.fileInfos.length),
                 progress: Utils.fillArray(0, nextProps.fileInfos.length)
-- 
cgit v1.2.3-1-g7c22

