mirror of
https://github.com/discourse/discourse.git
synced 2025-09-10 17:43:01 +08:00
Try to estimate the amount of notifications to return based on height
This commit is contained in:
parent
b3a930f2ed
commit
e624b7198d
2 changed files with 10 additions and 2 deletions
|
@ -7,7 +7,11 @@ class NotificationsController < ApplicationController
|
|||
def index
|
||||
user = current_user
|
||||
if params[:recent].present?
|
||||
notifications = Notification.recent_report(current_user, 15)
|
||||
|
||||
limit = params[:limit].to_i || 15
|
||||
limit = 50 if limit > 50
|
||||
|
||||
notifications = Notification.recent_report(current_user, limit)
|
||||
|
||||
if notifications.present?
|
||||
# ordering can be off due to PMs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue