From 09a7ce0c60d3e98eedf58f245bf2aaba9837785b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Feb 2023 15:05:59 +0100 Subject: [PATCH] Fix infinite scroll on search page --- client/src/app/+search/search.component.html | 2 +- client/src/app/+search/search.component.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/app/+search/search.component.html b/client/src/app/+search/search.component.html index 37da67005..c07dbab08 100644 --- a/client/src/app/+search/search.component.html +++ b/client/src/app/+search/search.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/client/src/app/+search/search.component.ts b/client/src/app/+search/search.component.ts index 366fbd459..31394a1d1 100644 --- a/client/src/app/+search/search.component.ts +++ b/client/src/app/+search/search.component.ts @@ -1,4 +1,4 @@ -import { forkJoin, Subscription } from 'rxjs' +import { forkJoin, Subject, Subscription } from 'rxjs' import { LinkType } from 'src/types/link.type' import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' @@ -44,6 +44,8 @@ export class SearchComponent implements OnInit, OnDestroy { userMiniature: User + onSearchDataSubject = new Subject() + private subActivatedRoute: Subscription private isInitialLoad = false // set to false to show the search filters on first arrival @@ -147,6 +149,8 @@ export class SearchComponent implements OnInit, OnDestroy { this.lastSearchTarget = this.advancedSearch.searchTarget this.hasMoreResults = this.results.length < this.pagination.totalItems + + this.onSearchDataSubject.next(results) }, error: err => { -- 2.41.0