fix password dialog

pull/1381/head
Audric Ackermann 5 years ago
parent 2a12427b11
commit 7b3981207e
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -982,6 +982,12 @@
}
});
Whisper.events.on('showPasswordDialog', async (options) => {
if (appView) {
appView.showPasswordDialog(options);
}
});
Whisper.events.on('showDevicePairingDialog', async (options = {}) => {
if (appView) {
appView.showDevicePairingDialog(options);

@ -524,11 +524,12 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
buttonText: window.i18n('setPassword'),
buttonColor: SessionButtonColor.Primary,
},
onClick: () =>
window.showPasswordDialog({
onClick: () => {
window.Whisper.events.trigger('showPasswordDialog', {
action: 'set',
onSuccess: this.onPasswordUpdated,
}),
});
},
confirmationDialogParams: undefined,
},
{
@ -544,11 +545,12 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
buttonText: window.i18n('changePassword'),
buttonColor: SessionButtonColor.Primary,
},
onClick: () =>
window.showPasswordDialog({
action: 'change',
onSuccess: this.onPasswordUpdated,
}),
onClick: () => {
window.Whisper.events.trigger('showPasswordDialog', {
action: 'change',
onSuccess: this.onPasswordUpdated,
});
},
confirmationDialogParams: undefined,
},
{
@ -564,11 +566,12 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
buttonText: window.i18n('removePassword'),
buttonColor: SessionButtonColor.Danger,
},
onClick: () =>
window.showPasswordDialog({
onClick: () => {
window.Whisper.events.trigger('showPasswordDialog', {
action: 'remove',
onSuccess: this.onPasswordUpdated,
}),
});
},
confirmationDialogParams: undefined,
},
];

2
ts/window.d.ts vendored

@ -81,8 +81,6 @@ declare global {
setSettingValue: any;
shortenPubkey: (pubKey: string) => string;
showEditProfileDialog: any;
showPasswordDialog: any;
showSeedDialog: any;
storage: any;
textsecure: LibTextsecure;
toggleLinkPreview: any;

Loading…
Cancel
Save