From 5b187ad25e8f25d2e141e5f852a56df4ab2c6e0b Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 17 Apr 2023 17:14:51 +0200 Subject: [PATCH] FIX: error when quoting message into topic (#21114) This error was only happening on mobile, note we also already have a (mobile) test (plugins/chat/spec/system/transcript_spec.rb:184) for this which was passing as it's only happening at a specific speed. I don't want to complicate the test too much for this case, will reconsider if it regresses again. --- .../assets/javascripts/discourse/services/chat-channel-pane.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane.js b/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane.js index 9e5e9461d86..91b118dbcff 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat-channel-pane.js @@ -16,7 +16,7 @@ export default class ChatChannelPane extends Service { @tracked sendingLoading = false; get selectedMessageIds() { - return this.chat.activeChannel.selectedMessages.mapBy("id"); + return this.chat.activeChannel?.selectedMessages?.mapBy("id") || []; } get composerService() {