mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-26 23:28:58 +03:00
Show file URI when invalid backup file is selected
This commit is contained in:
parent
0657a52924
commit
1704dc062d
1 changed files with 3 additions and 2 deletions
|
@ -243,7 +243,7 @@ class SettingsBackupScreen : SearchableSettings {
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
title = { Text(text = stringResource(R.string.invalid_backup_file)) },
|
title = { Text(text = stringResource(R.string.invalid_backup_file)) },
|
||||||
text = { Text(text = err.message) },
|
text = { Text(text = "${err.uri}\n\n${err.message}") },
|
||||||
dismissButton = {
|
dismissButton = {
|
||||||
TextButton(
|
TextButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
|
@ -308,7 +308,7 @@ class SettingsBackupScreen : SearchableSettings {
|
||||||
val results = try {
|
val results = try {
|
||||||
BackupFileValidator().validate(context, it)
|
BackupFileValidator().validate(context, it)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
error = InvalidRestore(e.message.toString())
|
error = InvalidRestore(it, e.message.toString())
|
||||||
return@rememberLauncherForActivityResult
|
return@rememberLauncherForActivityResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,5 +415,6 @@ private data class MissingRestoreComponents(
|
||||||
)
|
)
|
||||||
|
|
||||||
data class InvalidRestore(
|
data class InvalidRestore(
|
||||||
|
val uri: Uri,
|
||||||
val message: String,
|
val message: String,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue