mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-15 22:11:06 +00:00
Timeline: Check for task cancellation before loading next page
This commit is contained in:
parent
0f8c481bcb
commit
8c4b286751
1 changed files with 3 additions and 1 deletions
|
@ -304,7 +304,9 @@ extension TimelineViewModel: StatusesFetcher {
|
||||||
var allStatuses: [Status] = []
|
var allStatuses: [Status] = []
|
||||||
var latestMinId = minId
|
var latestMinId = minId
|
||||||
do {
|
do {
|
||||||
while var newStatuses: [Status] =
|
while
|
||||||
|
!Task.isCancelled,
|
||||||
|
var newStatuses: [Status] =
|
||||||
try await client.get(endpoint: timeline.endpoint(sinceId: nil,
|
try await client.get(endpoint: timeline.endpoint(sinceId: nil,
|
||||||
maxId: nil,
|
maxId: nil,
|
||||||
minId: latestMinId,
|
minId: latestMinId,
|
||||||
|
|
Loading…
Reference in a new issue