From d8ec2c33642f97bf22a9878da1cb35caac7344ba Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 16 Apr 2025 16:58:03 +0200 Subject: [PATCH] More natural to fetch that which will be shown first --- app/controllers/notifications_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 8471b20c0..44dc0f604 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -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