-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement new logic for backup prompt #6388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just a few non blocking nits
const { backupProvider, timesPromptedForBackup, lastBackupPromptAt } = backupsStore.getState(); | ||
|
||
// prompt for backup every week if first time prompting, otherwise prompt every 2 weeks | ||
if (lastBackupPromptAt && Date.now() - lastBackupPromptAt < oneWeekInMs * (timesPromptedForBackup + 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I thought this behavior would delay the next prompt by an additional week after every prompt (2 weeks, 3 weeks, etc). But it seems that timesPromptedForBackup
is only ever set to 0 or 1, which is kind of confusing because I would assume timesPromptedForBackup
gets incremented every time they are prompted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to spec we want 1 week after first prompt then every 2 weeks until backed up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I get that was just saying the variable being named timesPromptedForBackup
was confusing because it does not actually represent the number of times a user has been prompted for backup, it's only ever 0 or 1. Just a variable naming complaint, doesn't actually matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I could name it something like weeklyMultiplier
or something more representative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Fixes APP-2237
What changed (plus any additional context for devs)
1. Backup Sheet Component Updates
New Components
CloudBackupPrompt
component for cloud backup flowsManualBackupPrompt
component for manual backup flowsBackup Step Types Refactor
backup_prompt_manual
backup_prompt_cloud
create_cloud_backup
2. Backup Store Enhancements
New State Management
timesPromptedForBackup
counterlastBackupPromptAt
timestamp trackingPrompt Logic
3. Wallet Import Flow Improvements
Cloud Backup Integration
Error Handling
This PR significantly improves the backup system by introducing separate prompts for different backup types, implementing a smarter prompting system, and adding proper state management for backup-related user interactions.
Screen recordings / screenshots
// wip
What to test
TF 1.9.53 (7)