1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

premium callout

This commit is contained in:
Kyle Spearrin
2018-07-20 10:44:17 -04:00
parent b99df5905f
commit b9ea3de860
4 changed files with 21 additions and 4 deletions

View File

@@ -33,6 +33,7 @@ import { ShareComponent } from './share.component';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SyncService } from 'jslib/abstractions/sync.service';
import { TokenService } from 'jslib/abstractions/token.service';
import { UserService } from 'jslib/abstractions/user.service';
@@ -62,6 +63,7 @@ export class VaultComponent implements OnInit {
showVerifyEmail = false;
showBrowserOutdated = false;
showUpdateKey = false;
showPremiumCallout = false;
private modal: ModalComponent = null;
@@ -69,13 +71,17 @@ export class VaultComponent implements OnInit {
private router: Router, private location: Location,
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
private tokenService: TokenService, private cryptoService: CryptoService,
private messagingService: MessagingService, private userService: UserService) { }
private messagingService: MessagingService, private userService: UserService,
private platformUtilsService: PlatformUtilsService) { }
async ngOnInit() {
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
this.showBrowserOutdated = window.navigator.userAgent.indexOf('MSIE') !== -1;
const hasEncKey = await this.cryptoService.hasEncKey();
this.showUpdateKey = !hasEncKey;
const isPremium = await this.tokenService.getPremium();
this.showPremiumCallout = !this.showVerifyEmail && !isPremium &&
!this.platformUtilsService.isSelfHost();
this.route.queryParams.subscribe(async (params) => {
await this.syncService.fullSync(false);