From 3477be6b126afe767b0ebcbdb8b5f12967a372d2 Mon Sep 17 00:00:00 2001 From: Matt Vaughn Date: Sat, 2 Apr 2022 07:50:04 -0400 Subject: [PATCH] Make tab changes no longer cancel library loading --- .../mattpvaughn/chronicle/features/home/HomeViewModel.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/github/mattpvaughn/chronicle/features/home/HomeViewModel.kt b/app/src/main/java/io/github/mattpvaughn/chronicle/features/home/HomeViewModel.kt index 773a570..ccd9a70 100644 --- a/app/src/main/java/io/github/mattpvaughn/chronicle/features/home/HomeViewModel.kt +++ b/app/src/main/java/io/github/mattpvaughn/chronicle/features/home/HomeViewModel.kt @@ -140,11 +140,9 @@ class HomeViewModel( if (query.isEmpty()) { _searchResults.postValue(emptyList()) } else { - bookRepository.search(query).observeOnce( - Observer { - _searchResults.postValue(it) - } - ) + bookRepository.search(query).observeOnce { + _searchResults.postValue(it) + } } }