crisbeto / angular-svg-round-progressbar

Angular module that uses SVG to create a circular progressbar
https://crisbeto.github.io/angular-svg-round-progressbar/
MIT License
742 stars 173 forks source link

Issue on android and ios when the app is minified #111

Open nickimola opened 7 years ago

nickimola commented 7 years ago

Hi,

I've just noticed that on Android and iOS, when I minify the app, the timer is not refreshing properly.

How to reproduce:

Am I the only one facing this issue? Is it possible to fix?

I have also noticed that on android, if I set duration to 0, it updates properly, but still not on iOS.

Thanks

crisbeto commented 7 years ago

Thanks for the report. My guess is that the browser stops requestAnimationFrame when it gets minimized and then doesn't resume it when restoring focus.

nickimola commented 7 years ago

Do you know if there's a way to manually force it to restart when the app goes back to focus?

crisbeto commented 7 years ago

You may be able to do it by setting the value again on window.addEventListener('focus').

yurisbeljimenez commented 7 years ago

That is because the app in this case is not the main thread when you put it away you can avoid it using a web worker on Javascript and sending updates to the user interface. I know you're talking about native apps but this happens to me once using cordova to implement a user interface for a WiFi timer on a pfSense project and solved using a web worker since the scope of it is independent and that thread don't loose CPU cycles. That is also the way to go for push notifications but that is another topic.

On Mon, Feb 27, 2017, 6:58 AM Kristiyan Kostadinov notifications@github.com wrote:

You may be able to do it by setting the value again on window.addEventListener('focus').

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/crisbeto/angular-svg-round-progressbar/issues/111#issuecomment-282701257, or mute the thread https://github.com/notifications/unsubscribe-auth/AMqTzxeMe4GFZtqF2Tr5znJLkEbD3ZMcks5rgrpHgaJpZM4MM_Tk .

--

Sent from my Nexus 6P.