Skip to content

Commit

Permalink
feat: Use realm runCatchingRealm to avoid unhandled exception
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasBourdin88 committed Feb 19, 2025
1 parent cf245cb commit d965cf8
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,13 @@ class ThreadListFragment : TwoPaneFragment() {

private fun observeLoadMoreTriggers() = with(mainViewModel) {
Utils.waitInitMediator(currentFilter, currentFolderLive).observe(viewLifecycleOwner) { (filter, folder) ->
val shouldDisplayLoadMore = filter == ThreadFilter.ALL
&& folder.cursor != null
&& folder.oldMessagesUidsToFetch.isNotEmpty()
&& folder.threads.isNotEmpty()
threadListAdapter.updateLoadMore(shouldDisplayLoadMore)
runCatchingRealm {
val shouldDisplayLoadMore = filter == ThreadFilter.ALL
&& folder.cursor != null
&& folder.oldMessagesUidsToFetch.isNotEmpty()
&& folder.threads.isNotEmpty()
threadListAdapter.updateLoadMore(shouldDisplayLoadMore)
}
}
}

Expand Down

0 comments on commit d965cf8

Please sign in to comment.