mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-23 08:00:09 +02:00
fix null refs when no background (ff private mode)
This commit is contained in:
parent
6b42c1a16d
commit
72cb2772a6
@ -33,6 +33,8 @@ import { U2f } from '../../scripts/u2f';
|
||||
window.U2f = U2f;
|
||||
|
||||
import { Analytics } from '../../../jslib/src/misc/analytics';
|
||||
|
||||
if (BrowserApi.getBackgroundPage()) {
|
||||
new Analytics(window, () => BrowserApi.gaFilter(), null, null, null, () => {
|
||||
const bgPage = BrowserApi.getBackgroundPage();
|
||||
if (!bgPage || !bgPage.bitwardenMain) {
|
||||
@ -40,6 +42,7 @@ new Analytics(window, () => BrowserApi.gaFilter(), null, null, null, () => {
|
||||
}
|
||||
return bgPage.bitwardenMain;
|
||||
});
|
||||
}
|
||||
|
||||
// Model imports
|
||||
import { Attachment } from '../../../jslib/src/models/domain/attachment';
|
||||
|
@ -13,7 +13,10 @@ const authService = new AuthService(backgroundServices.cryptoService(), backgrou
|
||||
backgroundServices.userService(), backgroundServices.tokenService(), backgroundServices.appIdService(),
|
||||
backgroundServices.i18n2Service(), backgroundServices.platformUtilsService(),
|
||||
backgroundServices.constantsService(), messagingService);
|
||||
|
||||
if (backgroundServices.i18n2Service()) {
|
||||
authService.init();
|
||||
}
|
||||
|
||||
export default angular
|
||||
.module('bit.services', ['toastr'])
|
||||
|
@ -9,9 +9,11 @@ export class StateService {
|
||||
}
|
||||
|
||||
async init() {
|
||||
if (this.storageService != null) {
|
||||
const iconsDisabled = await this.storageService.get<boolean>(this.constantsService.disableFaviconKey);
|
||||
this.saveState('faviconEnabled', !iconsDisabled);
|
||||
}
|
||||
}
|
||||
|
||||
saveState(key: string, data: any) {
|
||||
this.state[key] = data;
|
||||
|
Loading…
Reference in New Issue
Block a user