Skip to content

Commit

Permalink
Fix clear reply to message and edit message state when you switch sta…
Browse files Browse the repository at this point in the history
…te (#10044)

This pull request fixes the following issue #10042.

Release Notes:
- Fixed clear chat state when switching edit/reply message state.
([#10042](#10042)).
  • Loading branch information
RemcoSmitsDev authored Apr 4, 2024
1 parent 9cbde74 commit c0d1171
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/collab_ui/src/chat_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,8 @@ impl ChatPanel {
.child(
IconButton::new(("reply", message_id), IconName::ReplyArrowRight)
.on_click(cx.listener(move |this, _, cx| {
this.cancel_edit_message(cx);

this.message_editor.update(cx, |editor, cx| {
editor.set_reply_to_message_id(message_id);
editor.focus_handle(cx).focus(cx);
Expand All @@ -636,6 +638,8 @@ impl ChatPanel {
IconButton::new(("edit", message_id), IconName::Pencil)
.on_click(cx.listener(move |this, _, cx| {
this.message_editor.update(cx, |editor, cx| {
editor.clear_reply_to_message_id();

let message = this
.active_chat()
.and_then(|active_chat| {
Expand Down

0 comments on commit c0d1171

Please sign in to comment.