From ac65b28954f9b967e06bff46edfa783bac0077c9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 9 Sep 2019 16:19:10 +0200 Subject: [PATCH] PR feedback --- src/components/views/rooms/MemberInfo.js | 13 ++++++------- src/i18n/strings/en_EN.json | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 8eee2f72b5..867e50ba0d 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -46,8 +46,7 @@ import SettingsStore from "../../../settings/SettingsStore"; import E2EIcon from "./E2EIcon"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import MatrixClientPeg from "../../../MatrixClientPeg"; -import Matrix from "matrix-js-sdk"; -const EventTimeline = Matrix.EventTimeline; +import {EventTimeline} from "matrix-js-sdk"; module.exports = withMatrixClient(React.createClass({ displayName: 'MemberInfo', @@ -393,7 +392,7 @@ module.exports = withMatrixClient(React.createClass({ description:

{ _t("You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?", {count, user}) }

-

{ _t("For large amount of messages, this might take some time. Please don't refresh your client in the meantime.") }

+

{ _t("For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.") }

, button: _t("Remove %(count)s messages", {count}), onFinished: resolve, @@ -405,9 +404,10 @@ module.exports = withMatrixClient(React.createClass({ } // Submitting a large number of redactions freezes the UI, - // so first wait 200ms to allow to rerender after closing the dialog. - await new Promise(resolve => setTimeout(resolve, 200)); + // so first yield to allow to rerender after closing the dialog. + await Promise.resolve(); + console.info(`Started redacting recent ${count} messages for ${user} in ${roomId}`); await Promise.all(eventsToRedact.map(async event => { try { await this.context.matrixClient.redactEvent(roomId, event.getId()); @@ -417,7 +417,7 @@ module.exports = withMatrixClient(React.createClass({ console.error(err); } })); - console.log("Done redacting recent messages!"); + console.info(`Finished redacting recent ${count} messages for ${user} in ${roomId}`); } }, @@ -958,7 +958,6 @@ module.exports = withMatrixClient(React.createClass({ ); } - if (this.state.can.redactMessages) { redactButton = ( diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 6c748018b9..2311a9219e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -728,7 +728,7 @@ "Try scrolling up in the timeline to see if there are any earlier ones.": "Try scrolling up in the timeline to see if there are any earlier ones.", "Remove recent messages by %(user)s": "Remove recent messages by %(user)s", "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|other": "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?", - "For large amount of messages, this might take some time. Please don't refresh your client in the meantime.": "For large amount of messages, this might take some time. Please don't refresh your client in the meantime.", + "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.": "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.", "Remove %(count)s messages|other": "Remove %(count)s messages", "Demote yourself?": "Demote yourself?", "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.",