#Frontend variable doesn't increment if the window is minimized.

12 messages ยท Page 1 of 1 (latest)

jaunty reef
#

I have this variable that I increment using setInterval frontend side.
If I wait for a bit then show the window again it appears that the variable has not been incremented during the (or at least the full) period of intervals when the window was minimized.

I'm using Svelte on top of Tauri, on windows.

winter isle
#

Afaik that's a webview optimization (at least on some platforms) that the webview gets frozen while it's not actively in view. Same kind of thing your browser does when you have a lot of tabs open at the same time

jaunty reef
winter isle
#

Yea, unfortunately I think so. Like I know we've talked about this at some point before in the discord and I believe this was the conclusion at least. There's nothing Tauri does at least that makes it stop executing

jaunty reef
# winter isle Yea, unfortunately I think so. Like I know we've talked about this at some point...

I thought so as well, before I stumbled upon this delightful module :) https://www.npmjs.com/package/worker-timers

#

Seems to work perfectly for my use case

winter isle
jaunty reef
winter isle
#

Join us in the dark side, we have Rust

#

That was the most "darth vader rusting" looking gif I found ๐Ÿ˜