mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
dont show billing page on self host
This commit is contained in:
parent
92b2601ba2
commit
8305b49046
@ -10,7 +10,7 @@
|
||||
<a routerLink="subscription" class="list-group-item" routerLinkActive="active">
|
||||
{{'subscription' | i18n}}
|
||||
</a>
|
||||
<a routerLink="billing" class="list-group-item" routerLinkActive="active">
|
||||
<a routerLink="billing" class="list-group-item" routerLinkActive="active" *ngIf="!selfHosted">
|
||||
{{'billing' | i18n}}
|
||||
</a>
|
||||
<a routerLink="two-factor" class="list-group-item" routerLinkActive="active" *ngIf="access2fa">
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
|
||||
@Component({
|
||||
@ -9,11 +10,14 @@ import { UserService } from 'jslib/abstractions/user.service';
|
||||
})
|
||||
export class SettingsComponent {
|
||||
access2fa = false;
|
||||
selfHosted: boolean;
|
||||
|
||||
constructor(private route: ActivatedRoute, private userService: UserService) { }
|
||||
constructor(private route: ActivatedRoute, private userService: UserService,
|
||||
private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.route.parent.params.subscribe(async (params) => {
|
||||
this.selfHosted = await this.platformUtilsService.isSelfHost();
|
||||
const organization = await this.userService.getOrganization(params.organizationId);
|
||||
this.access2fa = organization.use2fa;
|
||||
});
|
||||
|
@ -19,7 +19,7 @@
|
||||
<a routerLink="premium" class="list-group-item" routerLinkActive="active" *ngIf="!premium">
|
||||
{{'goPremium' | i18n}}
|
||||
</a>
|
||||
<a routerLink="billing" class="list-group-item" routerLinkActive="active">
|
||||
<a routerLink="billing" class="list-group-item" routerLinkActive="active" *ngIf="!selfHosted">
|
||||
{{'billing' | i18n}}
|
||||
</a>
|
||||
<a routerLink="two-factor" class="list-group-item" routerLinkActive="active">
|
||||
|
@ -5,6 +5,7 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
|
||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||
import { TokenService } from 'jslib/abstractions/token.service';
|
||||
|
||||
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||
@ -17,9 +18,10 @@ const BroadcasterSubscriptionId = 'SettingsComponent';
|
||||
})
|
||||
export class SettingsComponent implements OnInit, OnDestroy {
|
||||
premium: boolean;
|
||||
selfHosted: boolean;
|
||||
|
||||
constructor(private tokenService: TokenService, private broadcasterService: BroadcasterService,
|
||||
private ngZone: NgZone) { }
|
||||
private ngZone: NgZone, private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
|
||||
@ -33,6 +35,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
});
|
||||
|
||||
this.selfHosted = await this.platformUtilsService.isSelfHost();
|
||||
await this.load();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user