mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-03-28 04:25:28 +00:00
Don't fetch status accounts when already fetched
This commit is contained in:
parent
ead649125e
commit
1ac9d8a6f8
1 changed files with 3 additions and 0 deletions
|
@ -29,6 +29,7 @@ public class StatusRowViewModel: ObservableObject {
|
|||
@Published var isLoadingTranslation: Bool = false
|
||||
@Published var showDeleteAlert: Bool = false
|
||||
|
||||
private var actionsAccountsFetched: Bool = false
|
||||
@Published var favoriters: [Account] = []
|
||||
@Published var rebloggers: [Account] = []
|
||||
|
||||
|
@ -307,9 +308,11 @@ public class StatusRowViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
func fetchActionsAccounts() async {
|
||||
guard !actionsAccountsFetched else { return }
|
||||
do {
|
||||
favoriters = try await client.get(endpoint: Statuses.favoritedBy(id: status.id, maxId: nil))
|
||||
rebloggers = try await client.get(endpoint: Statuses.rebloggedBy(id: status.id, maxId: nil))
|
||||
actionsAccountsFetched = true
|
||||
} catch {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue