From 9e8f08aa494a2b7d59f975f039bad43a467bd430 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Sat, 14 Jun 2025 09:50:59 +0000 Subject: [PATCH] feat: improve backup file discovery and user guidance - Add enhanced logging for debugging when no backup files found - Improve "no backup files" UI with helpful guidance for users - Better file filtering to exclude system files from backup lists - Enhanced user experience for first-time users and permission-denied scenarios --- src/components/BackupFilesList.vue | 14 ++++++++++++++ .../platforms/CapacitorPlatformService.ts | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/components/BackupFilesList.vue b/src/components/BackupFilesList.vue index c084845f..b2485f4a 100644 --- a/src/components/BackupFilesList.vue +++ b/src/components/BackupFilesList.vue @@ -77,6 +77,20 @@

No backup files found

Create backups using the export functions above

+
+

💡 How to create backup files:

+
    +
  • • Use the "Export Contacts" button above to create contact backups
  • +
  • • Use the "Export Seed" button to backup your recovery phrase
  • +
  • • Backup files are saved to persistent storage that survives app installations
  • +
  • + • On Android: Files are saved to Downloads/TimeSafari or app data directory +
  • +
  • + • On iOS: Files are saved to Documents folder (accessible via Files app) +
  • +
+
diff --git a/src/services/platforms/CapacitorPlatformService.ts b/src/services/platforms/CapacitorPlatformService.ts index 7d9809a6..695ee6b5 100644 --- a/src/services/platforms/CapacitorPlatformService.ts +++ b/src/services/platforms/CapacitorPlatformService.ts @@ -1701,6 +1701,21 @@ export class CapacitorPlatformService implements PlatformService { platform: this.getCapabilities().isIOS ? "iOS" : "Android", timestamp: new Date().toISOString(), }); + + // If no backup files found, log helpful information for debugging + if (backupFiles.length === 0 && allFiles.length > 0) { + logger.log("[CapacitorPlatformService] No backup files found, but other files exist:", { + totalFiles: allFiles.length, + files: allFiles.map(f => ({ name: f.name, path: f.path })), + guidance: "To create backup files, use the export functionality in the app. Backup files should be JSON files or contain keywords like 'timesafari', 'backup', 'contacts', 'seed', 'export', or 'data'.", + timestamp: new Date().toISOString(), + }); + } else if (backupFiles.length === 0 && allFiles.length === 0) { + logger.log("[CapacitorPlatformService] No files found in any accessible location:", { + guidance: "This could be due to storage permissions being denied or no files being saved yet. Users can create backup files using the export functionality.", + timestamp: new Date().toISOString(), + }); + } return backupFiles; } catch (error) {