diff --git a/plugins/chat/app/models/chat/reviewable_message.rb b/plugins/chat/app/models/chat/reviewable_message.rb index 942e74c4aea..f10d23ba667 100644 --- a/plugins/chat/app/models/chat/reviewable_message.rb +++ b/plugins/chat/app/models/chat/reviewable_message.rb @@ -40,7 +40,8 @@ module Chat def build_actions(actions, guardian, args) return unless pending? - return if chat_message.blank? + + return build_action(actions, :ignore, icon: "external-link-alt") if chat_message.blank? agree = actions.add_bundle( diff --git a/plugins/chat/app/serializers/chat/reviewable_message_serializer.rb b/plugins/chat/app/serializers/chat/reviewable_message_serializer.rb index 051a118344e..97b18ac2508 100644 --- a/plugins/chat/app/serializers/chat/reviewable_message_serializer.rb +++ b/plugins/chat/app/serializers/chat/reviewable_message_serializer.rb @@ -15,7 +15,7 @@ module Chat end def chat_channel - object.chat_message.chat_channel + object.chat_message&.chat_channel end def target_id diff --git a/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs b/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs index 4635ab4585c..745f0df949d 100644 --- a/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.gjs @@ -17,22 +17,27 @@ export default class ReviewableChatMessage extends Component { @cached get channel() { + if (!this.args.reviewable.chat_channel) { + return; + } return ChatChannel.create(this.args.reviewable.chat_channel); }