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
This commit is contained in:
@@ -77,6 +77,20 @@
|
||||
<font-awesome icon="folder-open" class="fa-2x mb-2" />
|
||||
<p>No backup files found</p>
|
||||
<p class="text-sm mt-1">Create backups using the export functions above</p>
|
||||
<div class="mt-3 p-3 bg-blue-50 border border-blue-200 rounded-lg text-left">
|
||||
<p class="text-sm font-medium text-blue-800 mb-2">💡 How to create backup files:</p>
|
||||
<ul class="text-xs text-blue-700 space-y-1">
|
||||
<li>• Use the "Export Contacts" button above to create contact backups</li>
|
||||
<li>• Use the "Export Seed" button to backup your recovery phrase</li>
|
||||
<li>• Backup files are saved to persistent storage that survives app installations</li>
|
||||
<li v-if="platformCapabilities.isMobile && !platformCapabilities.isIOS" class="text-orange-700">
|
||||
• On Android: Files are saved to Downloads/TimeSafari or app data directory
|
||||
</li>
|
||||
<li v-if="platformCapabilities.isIOS" class="text-orange-700">
|
||||
• On iOS: Files are saved to Documents folder (accessible via Files app)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="space-y-2">
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user