RED-6420 - No refreshes anymore for new user notifications

This commit is contained in:
Valentin Mihai 2023-03-28 16:33:14 +03:00
parent e3f76fd7e0
commit 43a2191723
2 changed files with 5 additions and 5 deletions

View File

@ -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';
@ -43,11 +43,11 @@ export class DossiersChangesService extends GenericService<Dossier> {
}
hasChangesDetails$(): Observable<IDossierChanges> {
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<IDossierChanges>(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)),
);
}

@ -1 +1 @@
Subproject commit 9124c1f2847e67b44655e6a7d5a8b21b07c13468
Subproject commit d1e095ce6a3764f19f3bb7334b4524980e8f3dbb