From 364899b27dbf972164a9daa003d5a931bcb3d92e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Damir=20Jeli=C4=87?= <poljar@termina.org.uk>
Date: Fri, 6 Mar 2020 15:43:17 +0100
Subject: [PATCH] ManageEventIndexDialog: Show how many rooms are done instead
 being processed.

---
 .../views/dialogs/eventindex/ManageEventIndexDialog.js      | 6 ++++--
 src/i18n/strings/en_EN.json                                 | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.js b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.js
index f3ea3beb1c..8a5a0a3607 100644
--- a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.js
+++ b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.js
@@ -150,6 +150,8 @@ export default class ManageEventIndexDialog extends React.Component {
 
         const Field = sdk.getComponent('views.elements.Field');
 
+        const doneRooms = Math.max(0, (this.state.roomCount - this.state.crawlingRoomsCount));
+
         const eventIndexingSettings = (
             <div>
                 {
@@ -160,8 +162,8 @@ export default class ManageEventIndexDialog extends React.Component {
                 <div className='mx_SettingsTab_subsectionText'>
                     {_t("Space used:")} {formatBytes(this.state.eventIndexSize, 0)}<br />
                     {_t("Indexed messages:")} {formatCountLong(this.state.eventCount)}<br />
-                    {_t("Indexed rooms:")} {_t("%(crawlingRooms)s out of %(totalRooms)s", {
-                        crawlingRooms: formatCountLong(this.state.crawlingRoomsCount),
+                    {_t("Indexed rooms:")} {_t("%(doneRooms)s out of %(totalRooms)s", {
+                        doneRooms: formatCountLong(doneRooms),
                         totalRooms: formatCountLong(this.state.roomCount),
                     })} <br />
                     {crawlerState}<br />
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 35c3144241..f6f850d627 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -2136,7 +2136,7 @@
     "Space used:": "Space used:",
     "Indexed messages:": "Indexed messages:",
     "Indexed rooms:": "Indexed rooms:",
-    "%(crawlingRooms)s out of %(totalRooms)s": "%(crawlingRooms)s out of %(totalRooms)s",
+    "%(doneRooms)s out of %(totalRooms)s": "%(doneRooms)s out of %(totalRooms)s",
     "Message downloading sleep time(ms)": "Message downloading sleep time(ms)",
     "Failed to set direct chat tag": "Failed to set direct chat tag",
     "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",