From a2990d54e204fea2f4a2c7b2daff2b9827050cf3 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Wed, 20 Sep 2023 20:09:42 +0200 Subject: [PATCH] Calculate offset without loader-cell (IOS-141) Sorry, Stephen Fry! It wasn't anything personal --- .../SearchResult/SearchResultViewModel+State.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift index 4858f0d2d..e332b13d9 100644 --- a/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift +++ b/Mastodon/Scene/Search/SearchDetail/SearchResult/SearchResultViewModel+State.swift @@ -78,7 +78,13 @@ extension SearchResultViewModel.State { return } - offset = viewModel.items.count + offset = viewModel.items.filter({ item in + if case .bottomLoader(_) = item { + return false + } else { + return true + } + }).count // not set offset for all case // and assert other cases the items are all the same type elements