Skip to content

Commit 6d07079

Browse files
Merge branch 'main' into moo/MOO-2063-upgrade-react-native-reanimated
2 parents bcfe7ba + 0868b35 commit 6d07079

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/jsActions/nanoflow-actions-native/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
### Fixed
1010

1111
- We've fixed location permission issue on iOS.
12+
- We've fixed isConnectedToServer succeeding without internet on offline apps when service worker is enabled.
1213

1314
### Changed
1415

packages/jsActions/nanoflow-actions-native/src/client/IsConnectedToServer.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,18 @@
1515
export async function IsConnectedToServer(): Promise<boolean> {
1616
// BEGIN USER CODE
1717
try {
18-
const response = await fetch(mx.remoteUrl);
18+
const headers = new Headers();
19+
headers.append("Content-Type", "application/json");
20+
const body = JSON.stringify({ action: "info" });
21+
22+
const requestOptions = {
23+
method: "POST",
24+
headers,
25+
body
26+
};
27+
28+
// mx.remoteUrl always has / at the end, therefore we don't add it.
29+
const response = await fetch(`${mx.remoteUrl}xas/`, requestOptions);
1930
return response.ok;
2031
} catch (err) {
2132
console.error(err);

0 commit comments

Comments
 (0)