fix analytics

This commit is contained in:
Kyle Spearrin 2018-04-13 14:36:25 -04:00
parent e1626dfc43
commit 76eeb4e41d
2 changed files with 16 additions and 6 deletions

View File

@ -43,6 +43,8 @@ import { AuthService } from 'jslib/services/auth.service';
import { ConstantsService } from 'jslib/services/constants.service';
import { StateService } from 'jslib/services/state.service';
import { Analytics } from 'jslib/misc/analytics';
import { PopupUtilsService } from './popup-utils.service';
function getBgService<T>(service: string) {
@ -71,13 +73,21 @@ export function initFactory(i18nService: I18nService, storageService: StorageSer
window.document.body.classList.add('body-sm');
}
if (i18nService != null) {
window.document.documentElement.classList.add('locale_' + i18nService.translationLocale);
authService.init();
}
stateService.save(ConstantsService.disableFaviconKey,
await storageService.get<boolean>(ConstantsService.disableFaviconKey));
if (BrowserApi.getBackgroundPage() != null) {
window.document.documentElement.classList.add('locale_' + i18nService.translationLocale);
authService.init();
new Analytics(window, () => BrowserApi.gaFilter(), null, null, null, () => {
const bgPage = BrowserApi.getBackgroundPage();
if (bgPage == null || bgPage.bitwardenMain == null) {
throw 'Cannot resolve background page main.';
}
return bgPage.bitwardenMain;
});
}
};
}

View File

@ -2,7 +2,7 @@
<div class="left">
<app-pop-out [show]="!inSidebar"></app-pop-out>
<button type="button" appBlurClick (click)="refresh()" title="{{'refresh' | i18n}}" *ngIf="inSidebar">
<i class="fa fa-refresh fa-lg fa-fw"></i>
<i class="fa fa-retweet fa-lg fa-fw"></i>
</button>
</div>
<div class="search">