From 5e4789b218f93f8f75bc049397c48d68269971b1 Mon Sep 17 00:00:00 2001 From: Willie Koomson Date: Sat, 24 Jun 2023 14:23:25 -0700 Subject: [PATCH] Fix formatting --- app/src/main/java/com/jerboa/db/AppDB.kt | 3 ++- .../ui/components/community/list/CommunityListViewModel.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/jerboa/db/AppDB.kt b/app/src/main/java/com/jerboa/db/AppDB.kt index 6405c7b76..dd1078761 100644 --- a/app/src/main/java/com/jerboa/db/AppDB.kt +++ b/app/src/main/java/com/jerboa/db/AppDB.kt @@ -238,8 +238,9 @@ class SearchHistoryRepository( fun history(): Flow> = searchHistoryDao.history() suspend fun insert(item: SearchHistory) { - if (appSettingsDao.settings().first().saveSearchHistory) + if (appSettingsDao.settings().first().saveSearchHistory) { searchHistoryDao.insert(item) + } } suspend fun delete(item: SearchHistory) = searchHistoryDao.delete(item) diff --git a/app/src/main/java/com/jerboa/ui/components/community/list/CommunityListViewModel.kt b/app/src/main/java/com/jerboa/ui/components/community/list/CommunityListViewModel.kt index d41fdff4f..d5f82db36 100644 --- a/app/src/main/java/com/jerboa/ui/components/community/list/CommunityListViewModel.kt +++ b/app/src/main/java/com/jerboa/ui/components/community/list/CommunityListViewModel.kt @@ -29,8 +29,8 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import java.time.Instant -class CommunityListViewModelFactory(private val repository: SearchHistoryRepository) - : ViewModelProvider.Factory { +class CommunityListViewModelFactory(private val repository: SearchHistoryRepository) : + ViewModelProvider.Factory { override fun create(modelClass: Class): T { if (modelClass.isAssignableFrom(CommunityListViewModel::class.java)) { @Suppress("UNCHECKED_CAST")