animal-crossing-music-extension / ac-music-app

Play Animal Crossing's smooth background music in real-time throughout your day. A successor to the AC Music Extension.
https://acmusic.app
8 stars 2 forks source link

429 Too Many Requests from Open-Meteo #27

Open agausmann opened 5 months ago

agausmann commented 5 months ago

While messing around with manual location, I started seeing errors in the console. image

This might be caused by sending a request every time the manual location input changes (i.e. every time a user presses a key). This error shouldn't happen during typical use, but would still be good to resolve that.

Maybe it could have an "Apply" button, and the new values are set only when the user clicks apply. (This would also be good for #26 - just let the user enter whatever they want, and only validate when they try to apply it)

Taking it even further, should there be a single apply/cancel button for the whole config page?

PikaDude commented 5 months ago

hmm, that's a bit odd because it doesn't send a request whenever the input changes, only once the user loses focus of the text input.... at least in chrome. it appears that in firefox requests to the api are constantly flooded from the moment the app is opened which is definitely not correct lol.

i don't believe an apply or cancel button is necessary in this scenario, nor wanted due to autosaving being the preferred method for settings nowadays.

agausmann commented 5 months ago

I see, I'm just bad at searching. I couldn't find any focus events for input elements, and at the same time was confused why I kept getting search results for "blur" :man_facepalming:

If you want to reliably set the value when it loses focus, then we can try using either the focusout or blur events, which don't seem to be used right now.