From 467dc8d4245f2cee76b3fc94aa06d1b4427130d3 Mon Sep 17 00:00:00 2001 From: Julia Friesel <julia.friesel@gmail.com> Date: Fri, 14 Sep 2018 07:53:38 +0200 Subject: [PATCH] Add bacup warning --- components/labels.js | 5 ++++- components/settings/password-setting.js | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/components/labels.js b/components/labels.js index 814b6d3c..5f405fc1 100644 --- a/components/labels.js +++ b/components/labels.js @@ -6,7 +6,8 @@ export const shared = { warning: 'Warning', incorrectPassword: 'Password incorrect', incorrectPasswordMessage: 'That password is incorrect.', - tryAgain: 'Try again' + tryAgain: 'Try again', + ok: 'OK' } export const settings = { @@ -58,6 +59,8 @@ export const settings = { explainerEnabled: "Password protection and database encryption is currently enabled", deletePassword: "Delete password", enterCurrent: "Please enter your current password", + backupReminderTitle: 'Have you made a backup of your data?', + backupReminder: 'When you make changes to your password, we delete your old data and store it in a new version. To be safe, please backup your data using the export function before making changes to your password. Making any changes to your password setting will also restart the app immediately.', } } diff --git a/components/settings/password-setting.js b/components/settings/password-setting.js index 385fa5c6..210fadb0 100644 --- a/components/settings/password-setting.js +++ b/components/settings/password-setting.js @@ -92,7 +92,17 @@ export default class PasswordSetting extends Component { <TouchableOpacity onPress={() => { if (!this.state.enteringCurrentPassword) { - this.setState({ enteringCurrentPassword: true }) + Alert.alert( + labels.passwordSettings.backupReminderTitle, + labels.passwordSettings.backupReminder, + [{ + text: shared.cancel, + style: 'cancel' + }, { + text: shared.ok, + onPress: () => this.setState({enteringCurrentPassword: true}) + }] + ) } else { requestHash(this.state.currentPassword) } -- GitLab