From e0a75bc58631af2e78e45f7dbb2cd48a10912b8b Mon Sep 17 00:00:00 2001 From: Mickael Audel Date: Wed, 28 Feb 2024 17:49:24 +0100 Subject: [PATCH] fix: change detection error --- .../filters-handler/filters-handler.component.ts | 5 ++++- .../src/lib/components/search/search.component.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/arlas-toolkit/src/lib/components/filter-shortcut/filters-handler/filters-handler.component.ts b/projects/arlas-toolkit/src/lib/components/filter-shortcut/filters-handler/filters-handler.component.ts index 2426c6c8..ee6d6a86 100644 --- a/projects/arlas-toolkit/src/lib/components/filter-shortcut/filters-handler/filters-handler.component.ts +++ b/projects/arlas-toolkit/src/lib/components/filter-shortcut/filters-handler/filters-handler.component.ts @@ -29,6 +29,7 @@ import { TranslateService } from '@ngx-translate/core'; import { HistogramUtils, HistogramParams } from 'arlas-d3'; import { ChartType, DataType, ShortenNumberPipe } from 'arlas-web-components'; import { numberToShortString } from '../filter-shortcut.utils'; +import {delay} from "rxjs"; const moment = (_moment as any).default ? (_moment as any).default : _moment; @Component({ @@ -103,7 +104,9 @@ export class ShortcutFiltersHandlerComponent implements OnInit { this.checkCollaboration(collaboration); // Check if collaboration occurs during the lifetime of the shortcut - this.collaborativeSearchService.collaborationBus.subscribe(collaborationBus => { + this.collaborativeSearchService.collaborationBus + .pipe(delay(0)) + .subscribe(collaborationBus => { const collaboration = this.collaborativeSearchService.getCollaboration(this.contributorId); this.checkCollaboration(collaboration); }); diff --git a/projects/arlas-toolkit/src/lib/components/search/search.component.ts b/projects/arlas-toolkit/src/lib/components/search/search.component.ts index 47633e11..ea360eb7 100644 --- a/projects/arlas-toolkit/src/lib/components/search/search.component.ts +++ b/projects/arlas-toolkit/src/lib/components/search/search.component.ts @@ -24,7 +24,7 @@ import { Aggregation, AggregationResponse, Filter } from 'arlas-api'; import { ChipsSearchContributor } from 'arlas-web-contributors'; import { projType, Collaboration } from 'arlas-web-core'; import { ArlasCollaborativesearchService } from '../../services/startup/startup.service'; -import { Observable, Subject, from } from 'rxjs'; +import {Observable, Subject, from, delay} from 'rxjs'; import { filter, startWith, debounceTime, map, mergeMap, mergeWith } from 'rxjs/operators'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -74,6 +74,7 @@ export class SearchComponent implements OnInit { // Retrieve value from the url and future collaborations this.collaborativeService.collaborationBus.pipe( + delay(0), filter(e => this.searchContributor.isMyOwnCollaboration(e) || e.id === 'url' || e.id === 'all') ).subscribe( e => {