From 1704dc062d9f610ff1787260516893e697773108 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 27 Oct 2022 18:02:53 -0400 Subject: [PATCH] Show file URI when invalid backup file is selected --- .../more/settings/screen/SettingsBackupScreen.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt index cd174ac582..aed1f0ad44 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBackupScreen.kt @@ -243,7 +243,7 @@ class SettingsBackupScreen : SearchableSettings { AlertDialog( onDismissRequest = onDismissRequest, title = { Text(text = stringResource(R.string.invalid_backup_file)) }, - text = { Text(text = err.message) }, + text = { Text(text = "${err.uri}\n\n${err.message}") }, dismissButton = { TextButton( onClick = { @@ -308,7 +308,7 @@ class SettingsBackupScreen : SearchableSettings { val results = try { BackupFileValidator().validate(context, it) } catch (e: Exception) { - error = InvalidRestore(e.message.toString()) + error = InvalidRestore(it, e.message.toString()) return@rememberLauncherForActivityResult } @@ -415,5 +415,6 @@ private data class MissingRestoreComponents( ) data class InvalidRestore( + val uri: Uri, val message: String, )