mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 00:33:59 +00:00
fix possibility of 404 on home if getRandomGame has no validy elements to return
this can happen when user has no internet connection when opening hydra
This commit is contained in:
@@ -58,14 +58,12 @@ export function Home() {
|
||||
const getRandomGame = useCallback(() => {
|
||||
setIsLoadingRandomGame(true);
|
||||
|
||||
window.electron
|
||||
.getRandomGame()
|
||||
.then((objectID) => {
|
||||
window.electron.getRandomGame().then((objectID) => {
|
||||
if (objectID) {
|
||||
randomGameObjectID.current = objectID;
|
||||
})
|
||||
.finally(() => {
|
||||
setIsLoadingRandomGame(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleRandomizerClick = () => {
|
||||
|
||||
Reference in New Issue
Block a user