forked from shadowfacts/Tusker
Load account lists in pages of 40
This commit is contained in:
parent
49c9c69b5a
commit
1940368c43
|
@ -11,6 +11,8 @@ import Pachyderm
|
||||||
|
|
||||||
class AccountFollowsListViewController: UIViewController, CollectionViewController {
|
class AccountFollowsListViewController: UIViewController, CollectionViewController {
|
||||||
|
|
||||||
|
private static let pageSize = 40
|
||||||
|
|
||||||
let accountID: String
|
let accountID: String
|
||||||
let mastodonController: MastodonController
|
let mastodonController: MastodonController
|
||||||
let mode: AccountFollowsViewController.Mode
|
let mode: AccountFollowsViewController.Mode
|
||||||
|
@ -92,9 +94,9 @@ class AccountFollowsListViewController: UIViewController, CollectionViewControll
|
||||||
private func request(for range: RequestRange) -> Request<[Account]> {
|
private func request(for range: RequestRange) -> Request<[Account]> {
|
||||||
switch mode {
|
switch mode {
|
||||||
case .following:
|
case .following:
|
||||||
return Account.getFollowing(accountID, range: range)
|
return Account.getFollowing(accountID, range: range.withCount(Self.pageSize))
|
||||||
case .followers:
|
case .followers:
|
||||||
return Account.getFollowers(accountID, range: range)
|
return Account.getFollowers(accountID, range: range.withCount(Self.pageSize))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ import Pachyderm
|
||||||
|
|
||||||
class StatusActionAccountListCollectionViewController: UIViewController, CollectionViewController {
|
class StatusActionAccountListCollectionViewController: UIViewController, CollectionViewController {
|
||||||
|
|
||||||
|
private static let pageSize = 40
|
||||||
|
|
||||||
private let statusID: String
|
private let statusID: String
|
||||||
private let actionType: StatusActionAccountListViewController.ActionType
|
private let actionType: StatusActionAccountListViewController.ActionType
|
||||||
private let mastodonController: MastodonController
|
private let mastodonController: MastodonController
|
||||||
|
@ -147,9 +149,9 @@ class StatusActionAccountListCollectionViewController: UIViewController, Collect
|
||||||
private func request(for range: RequestRange) -> Request<[Account]> {
|
private func request(for range: RequestRange) -> Request<[Account]> {
|
||||||
switch actionType {
|
switch actionType {
|
||||||
case .favorite:
|
case .favorite:
|
||||||
return Status.getFavourites(statusID, range: range)
|
return Status.getFavourites(statusID, range: range.withCount(Self.pageSize))
|
||||||
case .reblog:
|
case .reblog:
|
||||||
return Status.getReblogs(statusID, range: range)
|
return Status.getReblogs(statusID, range: range.withCount(Self.pageSize))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue