mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Merge pull request #7226 from Bnyro/master
fix: current playlist doesn't close after deletion
This commit is contained in:
commit
83e121beb9
@ -41,11 +41,14 @@ class DeletePlaylistDialog : DialogFragment() {
|
||||
context.toastFromMainDispatcher(
|
||||
if (success) R.string.success else R.string.fail
|
||||
)
|
||||
withContext(Dispatchers.Main) {
|
||||
dismiss()
|
||||
|
||||
setFragmentResult(
|
||||
PlaylistOptionsBottomSheet.PLAYLIST_OPTIONS_REQUEST_KEY,
|
||||
bundleOf(IntentData.playlistTask to true)
|
||||
)
|
||||
withContext(Dispatchers.Main) { dismiss() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,9 +186,10 @@ class LibraryFragment : DynamicLayoutManagerFragment(R.layout.fragment_library)
|
||||
val binding = _binding ?: return@repeatOnLifecycle
|
||||
binding.playlistRefresh.isRefreshing = false
|
||||
|
||||
if (playlists.isNotEmpty()) {
|
||||
// also update playlists recycler when the playlists are empty in order to remove
|
||||
// playlists that were removed by the user
|
||||
showPlaylists(playlists)
|
||||
} else {
|
||||
if (playlists.isEmpty()) {
|
||||
binding.sortTV.isVisible = false
|
||||
binding.nothingHere.isVisible = true
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import androidx.core.view.isVisible
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -192,7 +193,7 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
|
||||
}
|
||||
|
||||
if (isPlaylistToBeDeleted) {
|
||||
// TODO move back: navController().popBackStack() crashes
|
||||
findNavController().popBackStack()
|
||||
return@setFragmentResultListener
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user