fix: enhance error handling for login and update launch button text based on server connection status

This commit is contained in:
HorizonCode 2025-07-02 14:59:15 +02:00
parent c97cfabfa4
commit 8acb33f844
2 changed files with 7 additions and 2 deletions

View File

@ -48,7 +48,12 @@ export const ezppfarm = {
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0',
}, },
}); });
if (request.error) return undefined; console.log(request.error);
if (request.error) {
if (request.error.status >= 500 && request.error.status < 600)
throw new Error('Server not reachable');
return undefined;
}
return request.data; return request.data;
}, },
}; };

View File

@ -297,7 +297,7 @@
}} }}
> >
<Play /> <Play />
Launch Launch {$server_connection_fails > 1 ? 'offline' : ''}
</Button> </Button>
</div> </div>
<div <div