From b7546a7015b0ff6afc8fbf13ce3a5ea856f07953 Mon Sep 17 00:00:00 2001 From: Flaminel Date: Wed, 28 May 2025 02:17:52 +0300 Subject: [PATCH] fixed dashboard streams not being populated at first --- .../dashboard-page/dashboard-page.component.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/code/UI/src/app/dashboard/dashboard-page/dashboard-page.component.ts b/code/UI/src/app/dashboard/dashboard-page/dashboard-page.component.ts index a52ddcec..53c0f195 100644 --- a/code/UI/src/app/dashboard/dashboard-page/dashboard-page.component.ts +++ b/code/UI/src/app/dashboard/dashboard-page/dashboard-page.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, OnDestroy, signal, computed, inject } from '@angular/core'; import { CommonModule, NgClass, DatePipe } from '@angular/common'; import { RouterLink } from '@angular/router'; -import { Subject, takeUntil, throttleTime } from 'rxjs'; +import { Subject, takeUntil } from 'rxjs'; // PrimeNG Components import { CardModule } from 'primeng/card'; @@ -72,12 +72,9 @@ export class DashboardPageComponent implements OnInit, OnDestroy { this.logHubService.startConnection() .catch((error: Error) => console.error('Failed to connect to log hub:', error)); - // Subscribe to logs with throttling to prevent UI overwhelming + // Subscribe to logs this.logHubService.getLogs() - .pipe( - takeUntil(this.destroy$), - throttleTime(1000) // Max 1 update per second - ) + .pipe(takeUntil(this.destroy$)) .subscribe((logs: LogEntry[]) => { this.recentLogs.set(logs); }); @@ -95,12 +92,9 @@ export class DashboardPageComponent implements OnInit, OnDestroy { this.eventHubService.startConnection() .catch((error: Error) => console.error('Failed to connect to event hub:', error)); - // Subscribe to events with throttling + // Subscribe to events this.eventHubService.getEvents() - .pipe( - takeUntil(this.destroy$), - throttleTime(1000) // Max 1 update per second - ) + .pipe(takeUntil(this.destroy$)) .subscribe((events: EventModel[]) => { this.recentEvents.set(events); });