mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
110889: Fixed trackStatistics still sending backend requests to track search event when trackStatistics is false
This commit is contained in:
@@ -485,18 +485,20 @@ export class SearchComponent implements OnDestroy, OnInit {
|
|||||||
* This method should only be called once and is essentially what SearchTrackingComponent used to do (now removed)
|
* This method should only be called once and is essentially what SearchTrackingComponent used to do (now removed)
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private subscribeToRoutingEvents() {
|
private subscribeToRoutingEvents(): void {
|
||||||
this.subs.push(
|
if (this.trackStatistics) {
|
||||||
this.router.events.pipe(
|
this.subs.push(
|
||||||
filter((event) => event instanceof NavigationStart),
|
this.router.events.pipe(
|
||||||
map((event: NavigationStart) => this.getDsoUUIDFromUrl(event.url)),
|
filter((event) => event instanceof NavigationStart),
|
||||||
hasValueOperator(),
|
map((event: NavigationStart) => this.getDsoUUIDFromUrl(event.url)),
|
||||||
).subscribe((uuid) => {
|
hasValueOperator(),
|
||||||
if (this.resultsRD$.value.hasSucceeded) {
|
).subscribe((uuid) => {
|
||||||
this.service.trackSearch(this.searchOptions$.value, this.resultsRD$.value.payload as SearchObjects<DSpaceObject>, uuid);
|
if (this.resultsRD$.value.hasSucceeded) {
|
||||||
}
|
this.service.trackSearch(this.searchOptions$.value, this.resultsRD$.value.payload as SearchObjects<DSpaceObject>, uuid);
|
||||||
}),
|
}
|
||||||
);
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user