shenanigans-be / miltydraft

19 stars 18 forks source link

Update draft picks without refreshing #21

Closed dizbpg closed 9 months ago

dizbpg commented 1 year ago
dizbpg commented 1 year ago

If this suggestion is accepted, I would like to undertake it myself.

shenanigans-be commented 11 months ago

Hi @dizbpg

This has been requested before, so I wouldn't mind seeing it implemented. The only caviat I'd suggest is to not just re-download the data on a timed interval, but instead listen for a window focus event or something and then check how long it's been since the data was refreshed. If people are going to leave this draft open for a couple of days (which is what I do usually) I would like to avoid the bandwidth of 100000 requests per user.

shenanigans-be commented 9 months ago

Based on @Keksike 's PR ( I implemented an automatic refresh when the visitor's tab becomes active. I feel like this is a decent compromise that doesn't put too much load on the server.