Skip to content

Commit aa37ac3

Browse files
authored
issue #1284 fix inbox pagination after refresh (#1287)
1 parent 66a4dcb commit aa37ac3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

FlowCrypt/Controllers/Inbox/InboxViewController.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,18 @@ extension InboxViewController {
228228
case .idle:
229229
fetchAndRenderEmails(context)
230230
case let .fetched(.byNumber(total)):
231-
if inboxInput.count != total {
232-
loadMore(context)
231+
guard inboxInput.count != total else {
232+
context?.completeBatchFetching(true)
233+
return
233234
}
235+
236+
loadMore(context)
234237
case let .fetched(.byNextPage(token)):
235-
guard token != nil else { return }
238+
guard token != nil else {
239+
context?.completeBatchFetching(true)
240+
return
241+
}
242+
236243
loadMore(context)
237244
case .empty:
238245
fetchAndRenderEmails(context)

0 commit comments

Comments
 (0)