This commit is contained in:
kunfei
2022-02-21 09:04:30 +08:00
parent 95df233016
commit 11eed6f35d
2 changed files with 2 additions and 6 deletions

View File

@@ -49,11 +49,7 @@ abstract class DiffRecyclerAdapter<ITEM, VB : ViewBinding>(protected val context
@Synchronized
fun setItems(items: List<ITEM>?) {
kotlin.runCatching {
if (items == null) {
asyncListDiffer.submitList(null)
} else {
asyncListDiffer.submitList(ArrayList(items))
}
asyncListDiffer.submitList(items)
}
}

View File

@@ -37,7 +37,7 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application
searchSuccess = {
if (!searchBooks.contains(it)) {
searchBooks.add(it)
trySend(searchBooks)
trySend(ArrayList(searchBooks))
}
}