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

Commit

Permalink
Handle possible edge case with getting stuck in "unsent messages" bar
Browse files Browse the repository at this point in the history
Just in case we're not cleaning up the isResending state properly, here's a catch all.

Unrelated to element-hq/element-web#17078 (this code doesn't affect the js-sdk error the author is seeing)
  • Loading branch information
turt2live committed Apr 27, 2021
1 parent 33617b0 commit b9bd83a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/structures/RoomStatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ export default class RoomStatusBar extends React.Component {

_onRoomLocalEchoUpdated = (event, room, oldEventId, oldStatus) => {
if (room.roomId !== this.props.room.roomId) return;
this.setState({unsentMessages: getUnsentMessages(this.props.room)});
const messages = getUnsentMessages(this.props.room);
this.setState({
unsentMessages: messages,
isResending: messages.length > 0 && this.state.isResending,
});
};

// Check whether current size is greater than 0, if yes call props.onVisible
Expand Down

0 comments on commit b9bd83a

Please sign in to comment.