1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

sweet alert dialog implementation

This commit is contained in:
Kyle Spearrin
2018-04-10 14:20:03 -04:00
parent e4a50cbbb0
commit 98b852287d
12 changed files with 109 additions and 38 deletions

View File

@@ -11,7 +11,6 @@ import { Analytics } from 'jslib/misc';
import {
CipherService,
PlatformUtilsService,
StorageService,
} from 'jslib/abstractions';
@@ -20,6 +19,7 @@ import { BrowserApi } from '../browser/browserApi';
import MainBackground from './main.background';
import { AutofillService } from '../services/abstractions/autofill.service';
import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service';
export default class RuntimeBackground {
private runtime: any;
@@ -29,7 +29,7 @@ export default class RuntimeBackground {
private onInstalledReason: string = null;
constructor(private main: MainBackground, private autofillService: AutofillService,
private cipherService: CipherService, private platformUtilsService: PlatformUtilsService,
private cipherService: CipherService, private platformUtilsService: BrowserPlatformUtilsService,
private storageService: StorageService, private i18nService: any, private analytics: Analytics) {
this.isSafari = this.platformUtilsService.isSafari();
this.runtime = this.isSafari ? safari.application : chrome.runtime;
@@ -90,6 +90,9 @@ export default class RuntimeBackground {
case 'openPopup':
await this.main.openPopup();
break;
case 'showDialogResolve':
this.platformUtilsService.resolveDialogPromise(msg.dialogId, msg.confirmed);
break;
case 'bgGetDataForTab':
await this.getDataForTab(sender.tab, msg.responseCommand);
break;