More natural to fetch that which will be shown first
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
class NotificationsController < ApplicationController
|
||||
def index
|
||||
set_page_and_extract_portion_from Current.user.notifications.read.ordered
|
||||
|
||||
if @page.first?
|
||||
unless current_page_param
|
||||
@unread = Current.user.notifications.unread.ordered
|
||||
end
|
||||
|
||||
set_page_and_extract_portion_from Current.user.notifications.read.ordered
|
||||
|
||||
respond_to do |format|
|
||||
format.turbo_stream if current_page_param # Allows read-all action to side step pagination
|
||||
format.html
|
||||
|
||||
Reference in New Issue
Block a user