FIX: correctly resets editing state when done (#23209)

Prior to this fix, attempting to reply to a recently edited message would show the edit icon instead of the reply icon.
This commit is contained in:
Joffrey JAFFEUX 2023-08-24 09:41:37 +02:00 committed by GitHub
parent af34e910f2
commit fc93604b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -539,6 +539,7 @@ export default class ChatChannel extends Component {
} catch (e) {
popupAjaxError(e);
} finally {
message.editing = false;
this.chatDraftsManager.remove({ channelId: this.args.channel.id });
this.pane.sending = false;
}

View File

@ -44,4 +44,16 @@ RSpec.describe "Edited message", type: :system do
expect(page).to have_css(".cooked-date")
end
end
context "when replying to and edited message" do
fab!(:message_1) { Fabricate(:chat_message, chat_channel: channel_1, user: current_user) }
it "shows the correct reply indicator" do
chat_page.visit_channel(channel_1)
channel_page.edit_message(message_1, message_1.message + "a")
channel_page.reply_to(message_1)
expect(channel_page.composer.message_details).to be_replying_to(message_1)
end
end
end