mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
limit animation progress to 1 in case tab loses focus or lags
This commit is contained in:
parent
9cb8d443ec
commit
f0d255c26b
@ -35,7 +35,7 @@ class CountWidget extends Component {
|
||||
let startTime = performance.now();
|
||||
|
||||
const tick = function(t) {
|
||||
let progress = ( t - startTime ) / duration;
|
||||
let progress = Math.min(( t - startTime ) / duration, 1);
|
||||
let newValue = startValue + (easeOutQuint(progress) * diff);
|
||||
setState({
|
||||
value: newValue,
|
||||
|
Loading…
x
Reference in New Issue
Block a user