Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5626c06

Browse files
committed
Show failures when sending messages
This is useful for the spam checking where otherwise you don't really know why your message has failed to send
1 parent ffb9dd8 commit 5626c06

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/components/structures/RoomView.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,17 @@ module.exports = React.createClass({
738738
_getUnsentMessageError: function(room) {
739739
const unsentMessages = this._getUnsentMessages(room);
740740
if (!unsentMessages.length) return "";
741+
742+
if (
743+
unsentMessages.length === 1 &&
744+
unsentMessages[0].error &&
745+
unsentMessages[0].error.data &&
746+
unsentMessages[0].error.data.error &&
747+
unsentMessages[0].error.name !== "UnknownDeviceError"
748+
) {
749+
return unsentMessages[0].error.data.error;
750+
}
751+
741752
for (const event of unsentMessages) {
742753
if (!event.error || event.error.name !== "UnknownDeviceError") {
743754
return _t("Some of your messages have not been sent.");

0 commit comments

Comments
 (0)