You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Clean up
This commit is contained in:
15
ReactNativeClient/lib/net-utils.js
Normal file
15
ReactNativeClient/lib/net-utils.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { shim } from 'lib/shim.js'
|
||||
|
||||
const netUtils = {};
|
||||
|
||||
netUtils.ip = async () => {
|
||||
let response = await shim.fetch('https://api.ipify.org/?format=json');
|
||||
if (!response.ok) {
|
||||
throw new Error('Could not retrieve IP: ' + await response.text());
|
||||
}
|
||||
|
||||
let ip = await response.json();
|
||||
return ip.ip;
|
||||
}
|
||||
|
||||
export { netUtils };
|
Reference in New Issue
Block a user