File tree Expand file tree Collapse file tree
app/src/main/java/com/github/libretube/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,14 @@ class DeletePlaylistDialog : DialogFragment() {
4141 context.toastFromMainDispatcher(
4242 if (success) R .string.success else R .string.fail
4343 )
44- setFragmentResult(
45- PlaylistOptionsBottomSheet .PLAYLIST_OPTIONS_REQUEST_KEY ,
46- bundleOf(IntentData .playlistTask to true )
47- )
48- withContext(Dispatchers .Main ) { dismiss() }
44+ withContext(Dispatchers .Main ) {
45+ dismiss()
46+
47+ setFragmentResult(
48+ PlaylistOptionsBottomSheet .PLAYLIST_OPTIONS_REQUEST_KEY ,
49+ bundleOf(IntentData .playlistTask to true )
50+ )
51+ }
4952 }
5053 }
5154 }
Original file line number Diff line number Diff line change @@ -186,9 +186,10 @@ class LibraryFragment : DynamicLayoutManagerFragment(R.layout.fragment_library)
186186 val binding = _binding ? : return @repeatOnLifecycle
187187 binding.playlistRefresh.isRefreshing = false
188188
189- if (playlists.isNotEmpty()) {
190- showPlaylists(playlists)
191- } else {
189+ // also update playlists recycler when the playlists are empty in order to remove
190+ // playlists that were removed by the user
191+ showPlaylists(playlists)
192+ if (playlists.isEmpty()) {
192193 binding.sortTV.isVisible = false
193194 binding.nothingHere.isVisible = true
194195 }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import androidx.core.view.isVisible
1414import androidx.core.view.updatePadding
1515import androidx.fragment.app.activityViewModels
1616import androidx.lifecycle.lifecycleScope
17+ import androidx.navigation.fragment.findNavController
1718import androidx.navigation.fragment.navArgs
1819import androidx.recyclerview.widget.GridLayoutManager
1920import androidx.recyclerview.widget.RecyclerView
@@ -192,7 +193,7 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
192193 }
193194
194195 if (isPlaylistToBeDeleted) {
195- // TODO move back: navController ().popBackStack() crashes
196+ findNavController ().popBackStack()
196197 return @setFragmentResultListener
197198 }
198199 }
You can’t perform that action at this time.
0 commit comments