Handle update with a page refresh so that both the list of subscribers and the bell update on the same operation

We can optimize with streams separately, this fixes a bug
This commit is contained in:
Jorge Manrubia
2025-10-03 18:25:04 +02:00
parent 656aa4f41e
commit e610bc981e
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -3,11 +3,11 @@ class Cards::WatchesController < ApplicationController
def create
@card.watch_by Current.user
redirect_to card_watch_path(@card)
redirect_back_or_to @card
end
def destroy
@card.unwatch_by Current.user
redirect_to card_watch_path(@card)
redirect_back_or_to @card
end
end
@@ -1,7 +1,7 @@
<%# FIXME: Let's move this aside outside of the card container section so these frames don't reload/flicker when card is replaced %>
<aside class="card-perma__actions card-perma__actions--right" role="toolbar">
<%= turbo_frame_tag card, :watch, src: card_watch_path(card) %>
<%= turbo_frame_tag card, :pin, src: card_pin_path(card) %>
<%= turbo_frame_tag card, :watch, src: card_watch_path(card), target: "_top", refresh: :morph %>
<%= turbo_frame_tag card, :pin, src: card_pin_path(card), refresh: :morph %>
</aside>
<%= render "cards/container/closure", card: card %>