Skip to content

Commit

Permalink
check server date for possitive and negative time differences
Browse files Browse the repository at this point in the history
  • Loading branch information
rabeatwork committed Nov 12, 2024
1 parent cd8607a commit 507826f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/webapp/app/shared/server-date.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ArtemisServerDateService implements ServerDateService {
const now = dayjs(new Date());
if (this.recentClientDates.length > 4) {
// only if some recent client dates (i.e. recent syncs) are older than 60s
shouldSync = this.recentClientDates.some((recentClientDate) => now.diff(recentClientDate, 's') > 60);
shouldSync = this.recentClientDates.some((recentClientDate) => Math.abs(now.diff(recentClientDate, 's')) > 60);
} else {
// definitely sync if we do not have 5 elements yet
shouldSync = true;
Expand Down

0 comments on commit 507826f

Please sign in to comment.