Skip to content

Commit

Permalink
Merge pull request #207 from PierreLevres/patch-1
Browse files Browse the repository at this point in the history
bug in stamp refresh moment
  • Loading branch information
Hacksore authored Feb 15, 2022
2 parents d085c5e + 34e67e6 commit abdce83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/constants/europe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const getStamp = (stampFileKey: string) => async (stampsFile?: string) => {
const generatedDate = new Date(generated);
const millisecondsSinceStampsGeneration = Date.now() - generatedDate.getTime();
const position = Math.floor(millisecondsSinceStampsGeneration / frequency);
if (position / stamps.length - 1 >= .9) {
if (position / (stamps.length - 1) >= .9) {
cachedStamps.delete(stampFileKey);
}
return stamps[Math.min(position, stamps.length - 1)];
Expand Down Expand Up @@ -123,4 +123,4 @@ export const getBrandEnvironment = (brand: Brand): EuropeanBrandEnvironment => {
default:
throw new Error(`Constructor ${brand} is not managed.`);
}
};
};

0 comments on commit abdce83

Please sign in to comment.