Skip to content

Suppress system role message broadcasts? #333

Closed Answered by tpaulshippy
UnderpantsGnome asked this question in Q&A
Discussion options

You must be logged in to vote

You would need to add a conditional on message.role.
Examples below are untested and based on this example.
Could do it on the back-end like this:

broadcasts_to ->(message) { 
    message.role != "system" ? [message.chat, "messages"] : nil
  }

or the front-end like this:

<%= turbo_frame_tag message do %>
  <% if message.role != "system" ? %>
  ...rest of code in partial...
  <% end %>
<% end %>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@UnderpantsGnome
Comment options

Answer selected by UnderpantsGnome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants