Fix count to zero as hiding account's counts

This commit is contained in:
KMY 2023-05-20 21:29:44 +09:00
parent 8c863323c1
commit 2a9fcced3b
6 changed files with 27 additions and 15 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.user&.setting_hide_followers_count ? 0 : @account.followers_count,
size: @account.public_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.user&.setting_hide_followers_count ? 0 : @account.followers_count,
size: @account.public_followers_count,
first: page_url(1)
)
end