pull/1419/head
gedoor 3 years ago
parent dc5f09243a
commit 3538db3fe5
  1. 7
      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()) { if (searchGroup.isBlank()) {
bookSourceList.addAll(appDb.bookSourceDao.allEnabled) bookSourceList.addAll(appDb.bookSourceDao.allEnabled)
} else { } 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) searchStateData.postValue(true)
initSearchPool() initSearchPool()

Loading…
Cancel
Save