mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-21 02:11:54 +01:00
[SM-1365] Fix organization ID not updating on overview swaps (#10189)
* fix org id not being updated in new-menu on org swaps * fix org suspended component
This commit is contained in:
parent
a437868727
commit
d4a1c1a997
@ -1,6 +1,6 @@
|
||||
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { Subject, takeUntil, concatMap, map } from "rxjs";
|
||||
import { Subject, takeUntil, concatMap } from "rxjs";
|
||||
|
||||
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
@ -36,16 +36,12 @@ export class NewMenuComponent implements OnInit, OnDestroy {
|
||||
ngOnInit() {
|
||||
this.route.params
|
||||
.pipe(
|
||||
concatMap((params) =>
|
||||
this.organizationService
|
||||
.get$(params.organizationId)
|
||||
.pipe(map((organization) => ({ params, organization }))),
|
||||
),
|
||||
concatMap(async (params) => await this.organizationService.get(params.organizationId)),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe((mapResult) => {
|
||||
this.organizationId = mapResult?.params?.organizationId;
|
||||
this.organizationEnabled = mapResult?.organization?.enabled;
|
||||
.subscribe((org) => {
|
||||
this.organizationId = org.id;
|
||||
this.organizationEnabled = org.enabled;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ export class OrgSuspendedComponent {
|
||||
|
||||
protected NoAccess: Icon = Icons.NoAccess;
|
||||
protected organizationName$ = this.route.params.pipe(
|
||||
concatMap((params) => this.organizationService.get$(params.organizationId)),
|
||||
concatMap(async (params) => await this.organizationService.get(params.organizationId)),
|
||||
map((org) => org?.name),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user