Improved the copy/move after choosing the storage

This commit is contained in:
MohitMaliFtechiz 2024-11-14 14:20:12 +05:30
parent b4e2a68944
commit daf2596fd8

View File

@ -162,6 +162,10 @@ class CopyMoveFileHandler @Inject constructor(
else EXTERNAL_SELECT_POSITION else EXTERNAL_SELECT_POSITION
) )
} }
performCopyMoveOperation()
}
private fun performCopyMoveOperation() {
if (validateZimFileCanCopyOrMove()) { if (validateZimFileCanCopyOrMove()) {
if (isMoveOperation) { if (isMoveOperation) {
performMoveOperation() performMoveOperation()
@ -198,7 +202,7 @@ class CopyMoveFileHandler @Inject constructor(
fun handleDetectingFileSystemState() { fun handleDetectingFileSystemState() {
if (isBookLessThan4GB()) { if (isBookLessThan4GB()) {
showCopyMoveDialog() performCopyMoveOperation()
} else { } else {
showPreparingCopyMoveDialog() showPreparingCopyMoveDialog()
observeFileSystemState() observeFileSystemState()
@ -207,7 +211,7 @@ class CopyMoveFileHandler @Inject constructor(
fun handleCannotWrite4GbFileState() { fun handleCannotWrite4GbFileState() {
if (isBookLessThan4GB()) { if (isBookLessThan4GB()) {
showCopyMoveDialog() performCopyMoveOperation()
} else { } else {
// Show an error dialog indicating the file system limitation // Show an error dialog indicating the file system limitation
fileCopyMoveCallback?.filesystemDoesNotSupportedCopyMoveFilesOver4GB() fileCopyMoveCallback?.filesystemDoesNotSupportedCopyMoveFilesOver4GB()
@ -221,7 +225,7 @@ class CopyMoveFileHandler @Inject constructor(
.subscribe { .subscribe {
hidePreparingCopyMoveDialog() hidePreparingCopyMoveDialog()
if (validateZimFileCanCopyOrMove()) { if (validateZimFileCanCopyOrMove()) {
showCopyMoveDialog() performCopyMoveOperation()
} }
} }
} }