From 938128209a883fe2ff5bcf2631d5ef64edd32b74 Mon Sep 17 00:00:00 2001 From: koalasat Date: Thu, 5 Dec 2024 13:09:07 +0100 Subject: [PATCH] Fix bug --- app/src/main/java/com/koalasat/pokey/ui/home/HomeFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/koalasat/pokey/ui/home/HomeFragment.kt b/app/src/main/java/com/koalasat/pokey/ui/home/HomeFragment.kt index 8f54f2a..ddc5842 100644 --- a/app/src/main/java/com/koalasat/pokey/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/koalasat/pokey/ui/home/HomeFragment.kt @@ -128,7 +128,7 @@ class HomeFragment : Fragment() { CoroutineScope(Dispatchers.IO).launch { val dao = AppDatabase.getDatabase(requireContext(), "common").applicationDao() val users = dao.getUsers() - if (users.isNotEmpty()) { + if (users.isNotEmpty() || viewModel.serviceStart.value == true) { viewModel.updateServiceStart(!viewModel.serviceStart.value!!) } else { withContext(Dispatchers.Main) {