Skip to content
Snippets Groups Projects
Commit e5dc7246 authored by vjrj's avatar vjrj
Browse files

Disable VPN check on web

parent a3ee9b20
No related branches found
No related tags found
No related merge requests found
...@@ -91,27 +91,28 @@ class ConnectivityWidgetWrapperWrapper extends ConnectivityWidgetWrapper { ...@@ -91,27 +91,28 @@ class ConnectivityWidgetWrapperWrapper extends ConnectivityWidgetWrapper {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FutureBuilder<bool>( return kIsWeb
future: CheckVpnConnection.isVpnActive(), ? super.build(context)
builder: (BuildContext context, AsyncSnapshot<bool> snapshot) { : FutureBuilder<bool>(
if (snapshot.hasData && snapshot.data != null) { future: CheckVpnConnection.isVpnActive(),
final bool isVpnActive = snapshot.data!; builder: (BuildContext context, AsyncSnapshot<bool> snapshot) {
if (isVpnActive) { if (snapshot.hasData && snapshot.data != null) {
return child; final bool isVpnActive = snapshot.data!;
} else { if (isVpnActive) {
return super.build(context); return child;
} } else {
} else { return super.build(context);
return super.build(context); }
} } else {
}); return super.build(context);
}
});
} }
// This package does not work in IOS so we just return true // This package does not work in IOS so we just return true
// Also does not detect well in web production mode // Also does not detect well in web production mode
static Future<bool> get isConnected async { static Future<bool> get isConnected async {
final bool vpn = await CheckVpnConnection.isVpnActive(); if (!kIsWeb && await CheckVpnConnection.isVpnActive()) {
if (vpn) {
return true; return true;
} }
return kIsWeb || isIOS return kIsWeb || isIOS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment