Skip to content

Commit

Permalink
fix: history data could be modified in some rare cases
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Oct 24, 2021
1 parent fa098b5 commit d38fd6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export default class GraphEntry {
(acc: { min: HistoryPoint; max: HistoryPoint }, point) => {
if (point[1] === null) return acc;
if (point[0] > end || point[0] < start) return acc;
if (acc.max[1] === null || acc.max[1] < point[1]) acc.max = point;
if (acc.min[1] === null || (point[1] !== null && acc.min[1] > point[1])) acc.min = point;
if (acc.max[1] === null || acc.max[1] < point[1]) acc.max = [...point];
if (acc.min[1] === null || (point[1] !== null && acc.min[1] > point[1])) acc.min = [...point];
return acc;
},
{ min: [0, null], max: [0, null] },
Expand Down

0 comments on commit d38fd6e

Please sign in to comment.