From af1b0310517f49129529b9a15d64746ea0de0e47 Mon Sep 17 00:00:00 2001 From: Roma Sosnovsky Date: Tue, 11 Jan 2022 13:27:10 +0200 Subject: [PATCH] #1284 fix inbox pagination after refresh --- .../Controllers/Inbox/InboxViewController.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/FlowCrypt/Controllers/Inbox/InboxViewController.swift b/FlowCrypt/Controllers/Inbox/InboxViewController.swift index 84b84cd88..44e5505e7 100644 --- a/FlowCrypt/Controllers/Inbox/InboxViewController.swift +++ b/FlowCrypt/Controllers/Inbox/InboxViewController.swift @@ -228,11 +228,18 @@ extension InboxViewController { case .idle: fetchAndRenderEmails(context) case let .fetched(.byNumber(total)): - if inboxInput.count != total { - loadMore(context) + guard inboxInput.count != total else { + context?.completeBatchFetching(true) + return } + + loadMore(context) case let .fetched(.byNextPage(token)): - guard token != nil else { return } + guard token != nil else { + context?.completeBatchFetching(true) + return + } + loadMore(context) case .empty: fetchAndRenderEmails(context)