diff --git a/apps/red-ui/src/app/services/dossiers/dossier-changes.service.ts b/apps/red-ui/src/app/services/dossiers/dossier-changes.service.ts index 7149d9d95..00a784754 100644 --- a/apps/red-ui/src/app/services/dossiers/dossier-changes.service.ts +++ b/apps/red-ui/src/app/services/dossiers/dossier-changes.service.ts @@ -1,4 +1,4 @@ -import { GenericService, LAST_CHECKED_OFFSET, QueryParam, ROOT_CHANGES_KEY } from '@iqser/common-ui'; +import { GenericService, QueryParam, ROOT_CHANGES_KEY } from '@iqser/common-ui'; import { Dossier, DossierStats, IDossierChanges } from '@red/domain'; import { forkJoin, Observable, of, Subscription, throwError, timer } from 'rxjs'; import { catchError, filter, map, switchMap, take, tap } from 'rxjs/operators'; @@ -47,7 +47,7 @@ export class DossiersChangesService extends GenericService implements O hasChangesDetails$(): Observable { const body = { value: this._lastCheckedForChanges.get(ROOT_CHANGES_KEY) }; - const dateBeforeRequest = new Date(Date.now() - LAST_CHECKED_OFFSET).toISOString(); + const dateBeforeRequest = new Date().toISOString(); this.#logger.info('[DOSSIERS_CHANGES] Check with Last Checked Date', body.value); diff --git a/apps/red-ui/src/app/services/notifications.service.ts b/apps/red-ui/src/app/services/notifications.service.ts index ad596231b..6b9fef61c 100644 --- a/apps/red-ui/src/app/services/notifications.service.ts +++ b/apps/red-ui/src/app/services/notifications.service.ts @@ -1,7 +1,7 @@ import { inject, Injectable, OnDestroy } from '@angular/core'; import { EntitiesService, getConfig, QueryParam } from '@iqser/common-ui'; import { TranslateService } from '@ngx-translate/core'; -import { EMPTY, firstValueFrom, iif, merge, Observable, of, Subscription, timer } from 'rxjs'; +import { EMPTY, firstValueFrom, merge, Observable, of, Subscription, timer } from 'rxjs'; import { AppConfig, Dossier, INotification, Notification, NotificationTypes } from '@red/domain'; import { map, switchMap, tap } from 'rxjs/operators'; import { notificationsTranslations } from '@translations/notifications-translations'; @@ -141,6 +141,14 @@ export class NotificationsService extends EntitiesService { - return this.hasChanges$().pipe(switchMap(changed => iif(() => changed, this.loadAll(), EMPTY))); + return this.hasChanges$().pipe( + switchMap(changed => { + if (changed) { + return this.loadAll(); + } else { + return EMPTY; + } + }), + ); } }