diff --git a/lib/ui/widgets/connectivity_widget_wrapper_wrapper.dart b/lib/ui/widgets/connectivity_widget_wrapper_wrapper.dart index b260027fb1d86ff61797e9df0def3f4b64df2bc7..7336efacc059ce8ba15c6f80e16505ddbd0eca42 100644 --- a/lib/ui/widgets/connectivity_widget_wrapper_wrapper.dart +++ b/lib/ui/widgets/connectivity_widget_wrapper_wrapper.dart @@ -91,27 +91,28 @@ class ConnectivityWidgetWrapperWrapper extends ConnectivityWidgetWrapper { @override Widget build(BuildContext context) { - return FutureBuilder<bool>( - future: CheckVpnConnection.isVpnActive(), - builder: (BuildContext context, AsyncSnapshot<bool> snapshot) { - if (snapshot.hasData && snapshot.data != null) { - final bool isVpnActive = snapshot.data!; - if (isVpnActive) { - return child; - } else { - return super.build(context); - } - } else { - return super.build(context); - } - }); + return kIsWeb + ? super.build(context) + : FutureBuilder<bool>( + future: CheckVpnConnection.isVpnActive(), + builder: (BuildContext context, AsyncSnapshot<bool> snapshot) { + if (snapshot.hasData && snapshot.data != null) { + final bool isVpnActive = snapshot.data!; + if (isVpnActive) { + return child; + } else { + return super.build(context); + } + } else { + return super.build(context); + } + }); } // This package does not work in IOS so we just return true // Also does not detect well in web production mode static Future<bool> get isConnected async { - final bool vpn = await CheckVpnConnection.isVpnActive(); - if (vpn) { + if (!kIsWeb && await CheckVpnConnection.isVpnActive()) { return true; } return kIsWeb || isIOS