[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:
Thomas Avery 2024-07-26 16:06:48 -05:00 committed by GitHub
parent a437868727
commit d4a1c1a997
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 10 deletions

View File

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

View File

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