PR feedback

This commit is contained in:
Bruno Windels 2019-09-09 16:19:10 +02:00 committed by David Baker
parent 0cba5da03d
commit ac65b28954
2 changed files with 7 additions and 8 deletions

View file

@ -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:
<div>
<p>{ _t("You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?", {count, user}) }</p>
<p>{ _t("For large amount of messages, this might take some time. Please don't refresh your client in the meantime.") }</p>
<p>{ _t("For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.") }</p>
</div>,
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 = (
<AccessibleButton className="mx_MemberInfo_field" onClick={this.onRedactAllMessages}>