3 ms·
I’ve built one of these before as a way of learning NextJS. One challenge I had was because it was a web app, it acted weirdly compared to if I had done it as
by sailorganymede 3y ago
I’ve built one of these before as a way of learning NextJS.
One challenge I had was because it was a web app, it acted weirdly compared to if I had done it as a native app.
You say you want to move from the monitor and relax the brain but your timer will not run if I turn off my phone screen and do something else (tested this btw). How do you plan on fixing that? I ask this because when I did it, I managed time client side so super curious what you would do.
- diogenesofweb 3y agoAlready using webworkers for ticking (settimeout) to deal with throttling in inactive tabs. It works ok on the desktop. But on mobile, when the screen is locked, I have no idea what can be done.
- sailorganymede 3y agoOne idea I tried was calculating the exact timestamp in seconds when the timer would end and showing the user the difference between the timestamp RN and the timer for that happening. That way if the user turned off their screen and came back, it would grab the new current timestamp, re-do the calculation and move on. It kind of worked too but I'd be a liar if I said it was better (clocks are unreliable AF) than just letting some backend handle that kind of stuff.