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