forked from jsnbuchanan/crowd-funder-for-time-pwa
feat: Add seed backup tracking with database migration
- Add hasBackedUpSeed boolean flag to Settings interface - Create database migration 003_add_hasBackedUpSeed_to_settings - Update SeedBackupView to set flag when user reveals seed phrase - Modify DataExportSection to conditionally show notification dot - Implement robust error handling for database operations The notification dot on the "Backup Identifier Seed" button only appears while the user hasn't backed up their seed phrase. Once they visit SeedBackupView and click "Reveal my Seed Phrase", the setting is persisted and the notification dot disappears.
This commit is contained in:
@@ -231,9 +231,24 @@ export default class SeedBackupView extends Vue {
|
||||
/**
|
||||
* Reveals the seed phrase to the user
|
||||
* Sets showSeed to true to display the sensitive seed phrase data
|
||||
* Updates the hasBackedUpSeed setting to true to track that user has backed up
|
||||
*/
|
||||
revealSeed(): void {
|
||||
async revealSeed(): Promise<void> {
|
||||
this.showSeed = true;
|
||||
|
||||
// Update the account setting to track that user has backed up their seed
|
||||
try {
|
||||
const settings = await this.$accountSettings();
|
||||
if (settings.activeDid) {
|
||||
await this.$saveUserSettings(settings.activeDid, {
|
||||
hasBackedUpSeed: true,
|
||||
});
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
logger.error("Failed to update hasBackedUpSeed setting:", err);
|
||||
// Don't show error to user as this is not critical to the main functionality
|
||||
// The seed phrase is still revealed, just the tracking won't work
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user