From 31825789a8c60cca7bb360811c51d06f1a44cd1c Mon Sep 17 00:00:00 2001 From: Milad Raeisi Date: Tue, 17 Dec 2024 11:09:27 +0400 Subject: [PATCH] Reset projects on service initialization and before fetching to ensure fresh data --- src/app/services/projects.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/services/projects.service.ts b/src/app/services/projects.service.ts index 30f9e77f..ac4e9817 100644 --- a/src/app/services/projects.service.ts +++ b/src/app/services/projects.service.ts @@ -41,9 +41,11 @@ export class ProjectsService { ) { this.selectedNetwork = this.indexerService.getNetwork(); console.log('Selected network:', this.selectedNetwork); + this.resetProjects(); // Ensure projects are reset and fetched on service initialization } fetchProjects(): Observable { + this.resetProjects(); // Reset projects to ensure fresh data is fetched if (this.loadingSubject.value || this.noMoreProjectsSubject.value) { console.log('Skipping fetch: Already loading or no more projects.'); return of([]);