diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt index 5771fde07..9249edc92 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt @@ -116,7 +116,12 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio if (searchGroup.isBlank()) { bookSourceList.addAll(appDb.bookSourceDao.allEnabled) } else { - bookSourceList.addAll(appDb.bookSourceDao.getEnabledByGroup(searchGroup)) + val sources = appDb.bookSourceDao.getEnabledByGroup(searchGroup) + if (sources.isEmpty()) { + bookSourceList.addAll(appDb.bookSourceDao.allEnabled) + } else { + bookSourceList.addAll(sources) + } } searchStateData.postValue(true) initSearchPool()