1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

updates to support electron 6

This commit is contained in:
Kyle Spearrin
2020-01-27 09:46:42 -05:00
parent 47617c6160
commit e1d42f95d9
3 changed files with 25 additions and 22 deletions

View File

@@ -114,9 +114,9 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
remote.dialog.showSaveDialog(remote.getCurrentWindow(), {
defaultPath: fileName,
showsTagField: false,
}, (path) => {
if (path != null) {
fs.writeFile(path, Buffer.from(blobData), (err) => {
}).then((ret) => {
if (ret.filePath != null) {
fs.writeFile(ret.filePath, Buffer.from(blobData), (err) => {
// error check?
});
}
@@ -147,14 +147,14 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
});
}
showDialog(text: string, title?: string, confirmText?: string, cancelText?: string, type?: string):
async showDialog(text: string, title?: string, confirmText?: string, cancelText?: string, type?: string):
Promise<boolean> {
const buttons = [confirmText == null ? this.i18nService.t('ok') : confirmText];
if (cancelText != null) {
buttons.push(cancelText);
}
const result = remote.dialog.showMessageBox(remote.getCurrentWindow(), {
const result = await remote.dialog.showMessageBox(remote.getCurrentWindow(), {
type: type,
title: title,
message: title,
@@ -165,7 +165,7 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
noLink: true,
});
return Promise.resolve(result === 0);
return Promise.resolve(result.response === 0);
}
eventTrack(action: string, label?: string, options?: any) {