mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-22 00:37:48 +01:00
inbox: redirect away if there's no questions filtered by author
This commit is contained in:
parent
30dec68e1b
commit
e5d8506a13
1 changed files with 5 additions and 0 deletions
|
@ -11,6 +11,11 @@ class InboxController < ApplicationController
|
||||||
@more_data_available = !current_user.cursored_inbox(last_id: @inbox_last_id, size: 1).then(&method(:filter_author_chain)).count.zero?
|
@more_data_available = !current_user.cursored_inbox(last_id: @inbox_last_id, size: 1).then(&method(:filter_author_chain)).count.zero?
|
||||||
@inbox_count = current_user.inboxes.then(&method(:filter_author_chain)).count
|
@inbox_count = current_user.inboxes.then(&method(:filter_author_chain)).count
|
||||||
|
|
||||||
|
if @author_user && @inbox_count.zero?
|
||||||
|
flash[:info] = t(".author.info", author: @author)
|
||||||
|
redirect_to inbox_path(last_id: params[:last_id])
|
||||||
|
end
|
||||||
|
|
||||||
@delete_id = if @author_user && @inbox_count.positive?
|
@delete_id = if @author_user && @inbox_count.positive?
|
||||||
"ib-delete-all-author"
|
"ib-delete-all-author"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue