better ux, how to inform when file already exists
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user