diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt index cf7dae196..a374c5e81 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/DeletePlaylistDialog.kt @@ -40,6 +40,7 @@ class DeletePlaylistDialog( DatabaseHolder.Database.localPlaylistsDao().deletePlaylistById(playlistId) DatabaseHolder.Database.localPlaylistsDao().deletePlaylistItemsByPlaylistId(playlistId) } + onSuccess.invoke() return } diff --git a/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt index d266180db..a37490b82 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/LibraryFragment.kt @@ -129,12 +129,14 @@ class LibraryFragment : BaseFragment() { // listen for playlists to become deleted playlistsAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { - override fun onChanged() { - binding.nothingHere.visibility = if (playlistsAdapter.itemCount == 0) View.VISIBLE else View.GONE - super.onChanged() + override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) { + binding.nothingHere.visibility = + if (playlistsAdapter.itemCount == 0) View.VISIBLE else View.GONE + super.onItemRangeRemoved(positionStart, itemCount) } }) + binding.nothingHere.visibility = View.GONE binding.playlistRecView.adapter = playlistsAdapter } else { runOnUiThread {