Skip to content

Commit

Permalink
Reset projects on service initialization and before fetching to ensur…
Browse files Browse the repository at this point in the history
…e fresh data
  • Loading branch information
miladsoft committed Dec 17, 2024
1 parent cb058d9 commit 3182578
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/services/projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project[]> {
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([]);
Expand Down

0 comments on commit 3182578

Please sign in to comment.