1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-25 10:25:36 +02:00

dont show billing page on self host

This commit is contained in:
Kyle Spearrin 2019-02-18 16:10:32 -05:00
parent 92b2601ba2
commit 8305b49046
4 changed files with 11 additions and 4 deletions

View File

@ -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">

View File

@ -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;
});

View File

@ -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">

View File

@ -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();
}