mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 22:15:23 +01:00
Fix unnecessary “next” link when API returns fewer notification requests than requested (#31541)
This commit is contained in:
parent
abe292b0ec
commit
98237207e6
1 changed files with 5 additions and 1 deletions
|
@ -75,13 +75,17 @@ class Api::V1::Notifications::RequestsController < Api::BaseController
|
|||
end
|
||||
|
||||
def next_path
|
||||
api_v1_notifications_requests_url pagination_params(max_id: pagination_max_id) unless @requests.empty?
|
||||
api_v1_notifications_requests_url pagination_params(max_id: pagination_max_id) if records_continue?
|
||||
end
|
||||
|
||||
def prev_path
|
||||
api_v1_notifications_requests_url pagination_params(min_id: pagination_since_id) unless @requests.empty?
|
||||
end
|
||||
|
||||
def records_continue?
|
||||
@requests.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
|
||||
end
|
||||
|
||||
def pagination_max_id
|
||||
@requests.last.id
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue