diff --git a/src/app/components/analogues/analogues.component.ts b/src/app/components/analogues/analogues.component.ts index 470e13dfb..3b61588fb 100644 --- a/src/app/components/analogues/analogues.component.ts +++ b/src/app/components/analogues/analogues.component.ts @@ -1,5 +1,5 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { BehaviorSubject } from 'rxjs'; +import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { BehaviorSubject, distinctUntilChanged } from 'rxjs'; import { EditionLevelType } from 'src/app/app.config'; import { AnalogueClass } from 'src/app/models/evt-models'; import { EVTStatusService } from 'src/app/services/evt-status.service'; @@ -8,6 +8,7 @@ import { EVTStatusService } from 'src/app/services/evt-status.service'; selector: 'evt-analogues', templateUrl: './analogues.component.html', styleUrls: ['./analogues.component.scss','../sources/sources.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, }) export class AnaloguesComponent implements OnInit { @@ -40,7 +41,7 @@ export class AnaloguesComponent implements OnInit { ) {} ngOnInit() { - this.analoguesInCurrentPage.subscribe({ next: (data) => { this.getEntries(data) } }); + this.analoguesInCurrentPage.pipe(distinctUntilChanged()).subscribe({ next: (data) => { this.getEntries(data) } }); } } diff --git a/src/app/components/sources/sources.component.ts b/src/app/components/sources/sources.component.ts index b3385c387..00f93da7b 100644 --- a/src/app/components/sources/sources.component.ts +++ b/src/app/components/sources/sources.component.ts @@ -1,13 +1,14 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { EVTStatusService } from 'src/app/services/evt-status.service'; import { SourceClass } from '../../models/evt-models'; -import { BehaviorSubject } from 'rxjs'; +import { BehaviorSubject, distinctUntilChanged } from 'rxjs'; import { EditionLevelType } from 'src/app/app.config'; @Component({ selector: 'evt-sources', templateUrl: './sources.component.html', styleUrls: ['./sources.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, }) export class SourcesComponent implements OnInit { @@ -40,7 +41,7 @@ export class SourcesComponent implements OnInit { ) {} ngOnInit() { - this.quotesInCurrentPage.subscribe({ next: (data) => { this.getEntries(data) } }); + this.quotesInCurrentPage.pipe(distinctUntilChanged()).subscribe({ next: (data) => { this.getEntries(data) } }); } } diff --git a/src/app/utils/dom-utils.ts b/src/app/utils/dom-utils.ts index 1b3cd518d..3fd5e9cbb 100644 --- a/src/app/utils/dom-utils.ts +++ b/src/app/utils/dom-utils.ts @@ -250,7 +250,8 @@ export function deepSearch(obj, attrToMatch: string, valuesToMatch, counter: num results = results.concat(deepSearch(value, attrToMatch, valuesToMatch, counter, ignoredProperties)); counter = counter - 1; } else { - console.log('EVT WARN: element is too deep, not searching further in', obj); + console.log('EVT WARN: element is too deep, not searching further in', obj, value); + counter = 4000; } } }