Skip to content

Commit

Permalink
[SM-1365] Fix organization ID not updating on overview swaps (#10189)
Browse files Browse the repository at this point in the history
* fix org id not being updated in new-menu on org swaps

* fix org suspended component
  • Loading branch information
Thomas-Avery authored and quexten committed Aug 2, 2024
1 parent 717a638 commit 48e6e6b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}

0 comments on commit 48e6e6b

Please sign in to comment.