inbox_controller: update all inbox entries when requesting turbo stream
since there's no layout rendered which updates all inbox entries the inbox entries would still be shown as unread fixes #827
This commit is contained in:
parent
0529247851
commit
a2ae98eee8
|
@ -49,7 +49,11 @@ class InboxController < ApplicationController
|
||||||
@disabled = true if @inbox.empty?
|
@disabled = true if @inbox.empty?
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.turbo_stream { render "show", layout: false, status: :see_other }
|
format.turbo_stream do
|
||||||
|
render "show", layout: false, status: :see_other
|
||||||
|
|
||||||
|
@inbox.update_all(new: false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,6 @@
|
||||||
= render 'shared/links'
|
= render 'shared/links'
|
||||||
|
|
||||||
:ruby
|
:ruby
|
||||||
Inbox.where(id: @inbox.ids).update_all(new: false)
|
@inbox.update_all(new: false)
|
||||||
provide(:title, generate_title('Inbox'))
|
provide(:title, generate_title('Inbox'))
|
||||||
parent_layout 'base'
|
parent_layout 'base'
|
||||||
|
|
Loading…
Reference in New Issue