2018-12-12 15:45:50 +01:00
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
OnInit,
|
|
|
|
} from '@angular/core';
|
|
|
|
|
|
|
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
|
|
|
import { UserService } from 'jslib/abstractions/user.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;
|
|
|
|
|
|
|
|
constructor(private userService: UserService, private messagingService: MessagingService) { }
|
|
|
|
|
|
|
|
async ngOnInit() {
|
|
|
|
this.canAccessPremium = await this.userService.canAccessPremium();
|
|
|
|
}
|
|
|
|
|
|
|
|
async premiumRequired() {
|
|
|
|
if (!this.canAccessPremium) {
|
|
|
|
this.messagingService.send('premiumRequired');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|