From 994e3891699c5d7b0deb1f1206a705b05dfd8555 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Mon, 27 Mar 2023 23:55:57 +0300 Subject: [PATCH] RED-6420 - No refreshes anymore for new user notifications --- .../src/app/services/dossiers/dossier-changes.service.ts | 8 ++++---- apps/red-ui/src/app/services/notifications.service.ts | 2 +- libs/common-ui | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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 ae62b488b..33b4950fe 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, List, QueryParam } from '@iqser/common-ui'; +import { GenericService, LAST_CHECKED_OFFSET, List, QueryParam, ROOT_CHANGES_KEY } from '@iqser/common-ui'; import { Dossier, DossierStats, IDossierChanges } from '@red/domain'; import { forkJoin, Observable, of, throwError, timer } from 'rxjs'; import { catchError, filter, map, switchMap, take, tap } from 'rxjs/operators'; @@ -42,11 +42,11 @@ export class DossiersChangesService extends GenericService { } hasChangesDetails$(): Observable { - const body = { value: this._lastCheckedForChanges.get('root') }; - const dateBeforeRequest = new Date().toISOString(); + const body = { value: this._lastCheckedForChanges.get(ROOT_CHANGES_KEY) }; + const dateBeforeRequest = new Date(Date.now() - LAST_CHECKED_OFFSET).toISOString(); return this._post(body, `${this._defaultModelPath}/changes/details`).pipe( filter(changes => changes.length > 0), - tap(() => this._lastCheckedForChanges.set('root', dateBeforeRequest)), + tap(() => this._lastCheckedForChanges.set(ROOT_CHANGES_KEY, dateBeforeRequest)), ); } diff --git a/apps/red-ui/src/app/services/notifications.service.ts b/apps/red-ui/src/app/services/notifications.service.ts index 5e4a5b2a4..4d353ed38 100644 --- a/apps/red-ui/src/app/services/notifications.service.ts +++ b/apps/red-ui/src/app/services/notifications.service.ts @@ -35,7 +35,7 @@ export class NotificationsService extends EntitiesService await firstValueFrom(this.loadAll())); } diff --git a/libs/common-ui b/libs/common-ui index b4156074e..ba21886e2 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit b4156074eb1951dfaa7e53aeec5611e466d817eb +Subproject commit ba21886e27187490c526816c4692c541384e1f5f