Fix output 0 as count when user set hide counts

This commit is contained in:
KMY 2023-05-19 19:05:35 +09:00
parent a5fcacaded
commit b50d851385
3 changed files with 5 additions and 5 deletions

View file

@ -63,7 +63,7 @@ class FollowerAccountsController < ApplicationController
ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account, page: params.fetch(:page, 1)),
type: :ordered,
size: @account.followers_count,
size: @account.user&.setting_hide_followers_count ? 0 : @account.followers_count,
items: follows.map { |follow| ActivityPub::TagManager.instance.uri_for(follow.account) },
part_of: account_followers_url(@account),
next: next_page_url,
@ -73,7 +73,7 @@ class FollowerAccountsController < ApplicationController
ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account),
type: :ordered,
size: @account.followers_count,
size: @account.user&.setting_hide_followers_count ? 0 : @account.followers_count,
first: page_url(1)
)
end