Skip to content

Commit

Permalink
fix: immediately change the line chart viewport when updating relativ…
Browse files Browse the repository at this point in the history
…e time range
  • Loading branch information
tracy-french authored and diehbria committed Nov 21, 2023
1 parent bc6fd3a commit 95b5b7d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export const useViewportToMS = (viewport?: Viewport) => {
useEffect(() => {
let interval: NodeJS.Timer;
if (viewport && isDurationViewport(viewport)) {
// Immediately change the viewport
setInMS(convertViewportToMs(viewport));

interval = setInterval(() => {
setInMS(convertViewportToMs(viewport));
}, LIVE_MODE_REFRESH_RATE_MS);
Expand Down

0 comments on commit 95b5b7d

Please sign in to comment.