better ux, how to inform when file already exists

This commit is contained in:
2026-03-10 14:23:37 +05:00
parent 0157954d16
commit 5b425fd0b7
3 changed files with 18 additions and 8 deletions

View File

@@ -417,13 +417,6 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val filePath = "${_uiState.value.currentPath}/$fileName"
val totalBytes = options.totalBytes
// Check if file already exists
val checkResult = RootManager.executeCommand("test -f \"$filePath\" && echo exists")
if (checkResult.output.trim() == "exists") {
_uiState.update { it.copy(errorMessage = "File already exists: $fileName") }
return@launch
}
// Start creating
_uiState.update {
it.copy(