Skip to content

Commit

Permalink
Do not show action menu when error happened
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Jul 30, 2023
1 parent d55adb4 commit d67f095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assets/view/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@
throw new Error('Can not append error when there is no pending message.');
var wasAtBottom = isPageBottom();
text.innerHTML += '<div class="error">' + error + '</div>';
var actionMenu = text.parentNode.getElementsByClassName('action-menu');
if (actionMenu)
text.parentNode.removeChild(actionMenu[0]);
endPending();
if (wasAtBottom)
scrollToBottom();
Expand Down
1 change: 1 addition & 0 deletions src/view/messages-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default class MessagesView extends BrowserView {
appendError(error: string) {
this.hasPendingMessage = false;
this.pushJavaScript(`window.appendError(${JSON.stringify(error)})`);
this.setReplyActions(['resend']);
}

// Add (aborted) label to the pending message.
Expand Down

0 comments on commit d67f095

Please sign in to comment.