Hide clone dialog before starting the clone.

This commit is contained in:
Isira Seneviratne 2023-02-20 20:20:27 +05:30
parent 38b3de6bed
commit 9a36a832a6

View File

@ -29,6 +29,7 @@ class CreatePlaylistDialog(
playlistUrl?.queryParameter("list")?.let { playlistUrl?.queryParameter("list")?.let {
lifecycleScope.launch { lifecycleScope.launch {
dialog?.hide()
val playlistId = withContext(Dispatchers.IO) { val playlistId = withContext(Dispatchers.IO) {
PlaylistsHelper.clonePlaylist(requireContext(), it) PlaylistsHelper.clonePlaylist(requireContext(), it)
} }
@ -38,7 +39,6 @@ class CreatePlaylistDialog(
appContext?.toastFromMainThread( appContext?.toastFromMainThread(
if (playlistId != null) R.string.playlistCloned else R.string.server_error if (playlistId != null) R.string.playlistCloned else R.string.server_error
) )
dismiss()
} }
} ?: run { } ?: run {
Toast.makeText(context, R.string.invalid_url, Toast.LENGTH_SHORT).show() Toast.makeText(context, R.string.invalid_url, Toast.LENGTH_SHORT).show()