1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-09 05:57:40 +02:00
bitwarden-browser/apps/web/src/app/tools/tools.component.ts

26 lines
706 B
TypeScript
Raw Normal View History

2021-12-17 15:57:11 +01:00
import { Component, OnInit } from "@angular/core";
2018-12-12 15:45:50 +01:00
2022-06-14 17:10:53 +02:00
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
import { StateService } from "@bitwarden/common/abstractions/state.service";
2018-06-10 05:33:12 +02:00
@Component({
2021-12-17 15:57:11 +01:00
selector: "app-tools",
templateUrl: "tools.component.html",
2018-06-10 05:33:12 +02:00
})
2018-12-12 15:45:50 +01:00
export class ToolsComponent implements OnInit {
2021-12-17 15:57:11 +01:00
canAccessPremium = false;
2018-12-12 15:45:50 +01:00
2021-12-17 15:57:11 +01:00
constructor(private stateService: StateService, private messagingService: MessagingService) {}
2018-12-12 15:45:50 +01:00
2021-12-17 15:57:11 +01:00
async ngOnInit() {
this.canAccessPremium = await this.stateService.getCanAccessPremium();
}
2018-12-12 15:45:50 +01:00
2021-12-17 15:57:11 +01:00
premiumRequired() {
if (!this.canAccessPremium) {
this.messagingService.send("premiumRequired");
return;
2018-12-12 15:45:50 +01:00
}
2021-12-17 15:57:11 +01:00
}
2018-12-12 15:45:50 +01:00
}