mirror of
https://github.com/bitwarden/browser
synced 2026-02-22 12:24:01 +00:00
clean up premium badge component
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Component, input, output } from "@angular/core";
|
||||
import { Component, input } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { PremiumUpgradePromptService } from "@bitwarden/common/vault/abstractions/premium-upgrade-prompt.service";
|
||||
import { BadgeModule } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
@@ -15,17 +15,11 @@ import { BadgeModule } from "@bitwarden/components";
|
||||
imports: [BadgeModule, JslibModule],
|
||||
})
|
||||
export class PremiumBadgeComponent {
|
||||
/** Skip sending the premiumRequired message (default: false). */
|
||||
skipMessaging = input(false);
|
||||
onClick = output();
|
||||
orgId = input<string>();
|
||||
|
||||
constructor(private messagingService: MessagingService) {}
|
||||
constructor(private premiumUpgradePromptService: PremiumUpgradePromptService) {}
|
||||
|
||||
async promptForPremium() {
|
||||
this.onClick.emit();
|
||||
if (this.skipMessaging()) {
|
||||
return;
|
||||
}
|
||||
this.messagingService.send("premiumRequired");
|
||||
await this.premiumUpgradePromptService.promptForPremium(this.orgId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user