Enable platform-specific export warning message (#295)
This commit is contained in:
parent
8328b55774
commit
b7acbcf3a7
|
@ -29,28 +29,13 @@ export class ExportComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
let acceptedWarning;
|
|
||||||
|
|
||||||
if (this.masterPassword == null || this.masterPassword === '') {
|
if (this.masterPassword == null || this.masterPassword === '') {
|
||||||
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
this.platformUtilsService.showToast('error', this.i18nService.t('errorOccurred'),
|
||||||
this.i18nService.t('invalidMasterPassword'));
|
this.i18nService.t('invalidMasterPassword'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.encryptedFormat) {
|
const acceptedWarning = await this.warningDialog();
|
||||||
acceptedWarning = await this.platformUtilsService.showDialog(
|
|
||||||
'<p>' + this.i18nService.t('encExportKeyWarningDesc') +
|
|
||||||
'<p>' + this.i18nService.t('encExportAccountWarningDesc'),
|
|
||||||
this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'),
|
|
||||||
this.i18nService.t('cancel'), 'warning',
|
|
||||||
true);
|
|
||||||
} else {
|
|
||||||
acceptedWarning = await this.platformUtilsService.showDialog(
|
|
||||||
this.i18nService.t('exportWarningDesc'),
|
|
||||||
this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'),
|
|
||||||
this.i18nService.t('cancel'), 'warning');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!acceptedWarning) {
|
if (!acceptedWarning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -72,6 +57,22 @@ export class ExportComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async warningDialog() {
|
||||||
|
if (this.encryptedFormat) {
|
||||||
|
return await this.platformUtilsService.showDialog(
|
||||||
|
'<p>' + this.i18nService.t('encExportKeyWarningDesc') +
|
||||||
|
'<p>' + this.i18nService.t('encExportAccountWarningDesc'),
|
||||||
|
this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'),
|
||||||
|
this.i18nService.t('cancel'), 'warning',
|
||||||
|
true);
|
||||||
|
} else {
|
||||||
|
return await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('exportWarningDesc'),
|
||||||
|
this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'),
|
||||||
|
this.i18nService.t('cancel'), 'warning');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
togglePassword() {
|
togglePassword() {
|
||||||
this.platformUtilsService.eventTrack('Toggled Master Password on Export');
|
this.platformUtilsService.eventTrack('Toggled Master Password on Export');
|
||||||
this.showPassword = !this.showPassword;
|
this.showPassword = !this.showPassword;
|
||||||
|
|
Loading…
Reference in New Issue