From dfed418ae240e50bc11ac1c2fa622da03b2fc4fe Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Mon, 6 Mar 2023 11:23:12 +0200 Subject: [PATCH] RED-6318: update last changed before the request --- .../src/app/services/dossiers/dossier-changes.service.ts | 7 +++++-- libs/common-ui | 2 +- 2 files changed, 6 insertions(+), 3 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 6e9de7601..efdf7c7fd 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 @@ -39,13 +39,16 @@ export class DossiersChangesService extends GenericService { switchMap(dossierChanges => forkJoin([...load(dossierChanges), this.#dashboardStatsService.loadAll().pipe(take(1))]).pipe(map(() => dossierChanges)), ), - tap(() => this._updateLastChanged()), ); } hasChangesDetails$(): Observable { const body = { value: this._lastCheckedForChanges.get('root') }; - return this._post(body, `${this._defaultModelPath}/changes/details`).pipe(filter(changes => changes.length > 0)); + const dateBeforeRequest = new Date().toISOString(); + return this._post(body, `${this._defaultModelPath}/changes/details`).pipe( + filter(changes => changes.length > 0), + tap(() => this._lastCheckedForChanges.set('root', dateBeforeRequest)), + ); } initializeRefresh() { diff --git a/libs/common-ui b/libs/common-ui index 33fb6b052..e21ca5059 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 33fb6b05252d32613af22d9bebae1cdde715badb +Subproject commit e21ca5059ecbd416de242f2564c731c7474c2e6c