From 34c404cf6c543c380f4e44aa6b2a3c2cd3e9a1cf Mon Sep 17 00:00:00 2001 From: futpib Date: Tue, 4 Dec 2018 15:12:41 +0300 Subject: [PATCH] Better perf when window is hidden --- components/graph/peaks.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/graph/peaks.js b/components/graph/peaks.js index 888a9c6..baf4361 100644 --- a/components/graph/peaks.js +++ b/components/graph/peaks.js @@ -71,6 +71,9 @@ class Peaks extends React.Component { } get targetDelay() { + if (window.document.hidden) { + return 2 * 1000; + } if (this.props.accommodateGraphAnimation) { return 1000 / 70; }