Fix inability to create a backup

This commit is contained in:
Zakhar Timoshenko
2021-09-14 03:26:08 +03:00
committed by Koitharu
parent 174c6649e0
commit 7618a05162

View File

@@ -14,6 +14,7 @@ import org.koitharu.kotatsu.R
import org.koitharu.kotatsu.base.ui.AlertDialogFragment
import org.koitharu.kotatsu.databinding.DialogProgressBinding
import org.koitharu.kotatsu.utils.ext.getDisplayMessage
import org.koitharu.kotatsu.utils.ext.setIndeterminateCompat
import org.koitharu.kotatsu.utils.progress.Progress
import java.io.File
import java.io.FileOutputStream
@@ -64,8 +65,8 @@ class BackupDialogFragment : AlertDialogFragment<DialogProgressBinding>() {
private fun onProgressChanged(progress: Progress?) {
with(binding.progressBar) {
setIndeterminateCompat(progress == null)
isVisible = true
isIndeterminate = progress == null
if (progress != null) {
this.max = progress.total
this.progress = progress.value