mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-31 22:51:28 +01:00
Expand encrypted export warning (#294)
* Allow html body in showDialog * Add extra warnings about encrypted export
This commit is contained in:
parent
729ab4f20b
commit
8328b55774
@ -25,8 +25,8 @@ export abstract class PlatformUtilsService {
|
|||||||
supportsDuo: () => boolean;
|
supportsDuo: () => boolean;
|
||||||
showToast: (type: 'error' | 'success' | 'warning' | 'info', title: string, text: string | string[],
|
showToast: (type: 'error' | 'success' | 'warning' | 'info', title: string, text: string | string[],
|
||||||
options?: any) => void;
|
options?: any) => void;
|
||||||
showDialog: (text: string, title?: string, confirmText?: string, cancelText?: string,
|
showDialog: (body: string, title?: string, confirmText?: string, cancelText?: string,
|
||||||
type?: string) => Promise<boolean>;
|
type?: string, bodyIsHtml?: boolean) => Promise<boolean>;
|
||||||
eventTrack: (action: string, label?: string, options?: any) => void;
|
eventTrack: (action: string, label?: string, options?: any) => void;
|
||||||
isDev: () => boolean;
|
isDev: () => boolean;
|
||||||
isSelfHost: () => boolean;
|
isSelfHost: () => boolean;
|
||||||
|
@ -29,16 +29,27 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
const acceptedWarning = await this.platformUtilsService.showDialog(
|
if (this.encryptedFormat) {
|
||||||
this.i18nService.t(this.encryptedFormat ? 'encExportWarningDesc' : 'exportWarningDesc'),
|
acceptedWarning = await this.platformUtilsService.showDialog(
|
||||||
this.i18nService.t('confirmVaultExport'), this.i18nService.t('exportVault'),
|
'<p>' + this.i18nService.t('encExportKeyWarningDesc') +
|
||||||
this.i18nService.t('cancel'), 'warning');
|
'<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;
|
||||||
|
Loading…
Reference in New Issue
Block a user