Skip to content
Snippets Groups Projects
Commit a291c783 authored by mashazyu's avatar mashazyu
Browse files

Delete password button bug fix

parent 772a2773
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ export default class CreatePassword extends Component {
}
startSettingPassword = () => {
showBackUpReminder(this.toggleSettingPassword)
showBackUpReminder(this.toggleSettingPassword, () => {})
}
render () {
......
......@@ -14,7 +14,7 @@ export default class DeletePassword extends Component {
startConfirmWithPassword = () => {
this.setState({ enteringCurrentPassword: true })
this.props.onStartDeletingPassword()
this.props.onStartDelete()
}
startDeletePassword = async () => {
......@@ -23,6 +23,7 @@ export default class DeletePassword extends Component {
cancelConfirmationWithPassword = () => {
this.setState({ enteringCurrentPassword: false })
this.props.onCancelDelete()
}
render() {
......
......@@ -24,10 +24,18 @@ export default class PasswordSetting extends Component {
this.setState({ isChangingPassword: true })
}
onCancelChangingPassword = () => {
this.setState({ isChangingPassword: false })
}
onDeletingPassword = () => {
this.setState({ isDeletingPassword: true })
}
onCancelDeletingPassword = () => {
this.setState({ isDeletingPassword: false })
}
render() {
const {
......@@ -53,13 +61,15 @@ export default class PasswordSetting extends Component {
{ (isPasswordSet && !isDeletingPassword) && (
<ChangePassword
onStartChangingPassword = {this.onChangingPassword}
onStartChange = {this.onChangingPassword}
onCancelChange = {this.onCancelChangingPassword}
/>
)}
{ (isPasswordSet && !isChangingPassword) && (
<DeletePassword
onStartDeletingPassword = {this.onDeletingPassword}
onStartDelete = {this.onDeletingPassword}
onCancelDelete = {this.onCancelDeletingPassword}
/>
)}
</FramedSegment>
......
......@@ -2,7 +2,7 @@ import { Alert } from 'react-native'
import { shared } from '../../../i18n/en/labels'
import labels from '../../../i18n/en/settings'
export default function showBackUpReminder(okHandler, isDelete) {
export default function showBackUpReminder(okHandler, cancelHandler, isDelete) {
let title, message
if (isDelete) {
title = labels.passwordSettings.deleteBackupReminderTitle
......@@ -17,10 +17,12 @@ export default function showBackUpReminder(okHandler, isDelete) {
message,
[{
text: shared.cancel,
onPress: cancelHandler,
style: 'cancel'
}, {
text: shared.ok,
onPress: okHandler
}]
}],
{ onDismiss: cancelHandler }
)
}
\ No newline at end of file
......@@ -17,10 +17,15 @@ export default class ChangePassword extends Component {
}
startChangingPassword = () => {
showBackUpReminder(() => {
this.setState({ enteringCurrentPassword: true })
})
this.props.onStartChangingPassword()
showBackUpReminder(
this.startEnteringCurrentPassword,
this.cancelConfirmationWithPassword
)
}
startEnteringCurrentPassword = () => {
this.setState({ enteringCurrentPassword: true })
this.props.onStartChange()
}
startEnteringNewPassword = () => {
......@@ -37,6 +42,7 @@ export default class ChangePassword extends Component {
enteringNewPassword: false,
enteringCurrentPassword: false
})
this.props.onCancelChange()
}
render() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment