mirror of
https://github.com/bitwarden/browser
synced 2026-02-02 17:53:41 +00:00
PM-26676 Update report when org changes
This commit is contained in:
@@ -163,6 +163,7 @@ export class RiskInsightsOrchestratorService {
|
||||
initializeForOrganization(organizationId: OrganizationId) {
|
||||
this.logService.debug("[RiskInsightsOrchestratorService] Initializing for org", organizationId);
|
||||
this._initializeOrganizationTriggerSubject.next(organizationId);
|
||||
this.fetchReport();
|
||||
}
|
||||
|
||||
removeCriticalApplication$(criticalApplication: string): Observable<ReportState> {
|
||||
@@ -581,7 +582,7 @@ export class RiskInsightsOrchestratorService {
|
||||
private _setupEnrichedReportData() {
|
||||
// Setup the enriched report data pipeline
|
||||
const enrichmentSubscription = combineLatest([
|
||||
this.rawReportData$.pipe(filter((data) => !!data && !!data?.data)),
|
||||
this.rawReportData$,
|
||||
this._ciphers$.pipe(filter((data) => !!data)),
|
||||
]).pipe(
|
||||
switchMap(([rawReportData, ciphers]) => {
|
||||
@@ -621,7 +622,7 @@ export class RiskInsightsOrchestratorService {
|
||||
.pipe(
|
||||
withLatestFrom(this._userId$),
|
||||
filter(([orgId, userId]) => !!orgId && !!userId),
|
||||
exhaustMap(([orgId, userId]) =>
|
||||
switchMap(([orgId, userId]) =>
|
||||
this.organizationService.organizations$(userId!).pipe(
|
||||
getOrganizationById(orgId),
|
||||
map((org) => ({ organizationId: orgId!, organizationName: org?.name ?? "" })),
|
||||
@@ -718,7 +719,7 @@ export class RiskInsightsOrchestratorService {
|
||||
scan((prevState: ReportState, currState: ReportState) => ({
|
||||
...prevState,
|
||||
...currState,
|
||||
data: currState.data !== null ? currState.data : prevState.data,
|
||||
data: currState.data, // currState.data !== null ? currState.data : prevState.data,
|
||||
})),
|
||||
startWith({ loading: false, error: null, data: null }),
|
||||
shareReplay({ bufferSize: 1, refCount: true }),
|
||||
|
||||
Reference in New Issue
Block a user