Skip to content

Commit

Permalink
Merge pull request #6 from ynhhoJ/bugfixes/connection-to-internet
Browse files Browse the repository at this point in the history
Add log messages in "checkOnlineStatus" method
  • Loading branch information
ynhhoJ authored Aug 28, 2024
2 parents 8ad16a4 + 2d76deb commit 337ed70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emuchievements",
"version": "2.1.3-0",
"version": "2.1.4-0",
"description": "Plugin for viewing RetroAchievements progress. Part of the EmuDeck Project",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
Expand Down
2 changes: 2 additions & 0 deletions src/ts/steam-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ export async function checkOnlineStatus(serverAPI: ServerAPI)
try
{
const online = await serverAPI.fetchNoCors<{ body: string; status: number; }>("https://example.com");
console.error('[checkOnlineStatus] OK: ', online.success, online.result, online)
return online.success && online.result.status >= 200; // either true or false
} catch (err)
{
console.error('[checkOnlineStatus] Error: ', err)
return false; // definitely offline
}
}
Expand Down

0 comments on commit 337ed70

Please sign in to comment.