mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-27 12:59:17 +01:00
Don't fetch status accounts when already fetched
This commit is contained in:
parent
ead649125e
commit
1ac9d8a6f8
@ -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…
x
Reference in New Issue
Block a user