hydra
hydra copied to clipboard
Feat/enhance get random game
Refactor logic of getting random games
- On the first call of getRandomGame, Hydra makes all the requests to steam250 pages
- Removes duplicates games from the list
- Removes games that are not indexed on Hydra
- And shuffles the resulting list
- Now, on each new call to getRandomGame, there's no need to make a new request, it just gets the next game on the list
- If the end of the list is reached, it is shuffled again and moves the index to the start of the list
Other adjustments
- Makes the Surprise me button disabled until the game details page finishes loading, preventing a click spam on the button that could cause some strange behaviours on the page