mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-16 18:12:29 -06:00
Changed application id, fixed network address lookup in login page
This commit is contained in:
@@ -17,22 +17,19 @@ class ConnectivityStatusServiceImpl implements ConnectivityStatusService {
|
||||
|
||||
@override
|
||||
Stream<bool> connectivityChanges() {
|
||||
return connectivity.onConnectivityChanged
|
||||
.map(_hasActiveInternetConnection)
|
||||
.asBroadcastStream();
|
||||
return connectivity.onConnectivityChanged.map(_hasActiveInternetConnection).asBroadcastStream();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isConnectedToInternet() async {
|
||||
return _hasActiveInternetConnection(
|
||||
await (Connectivity().checkConnectivity()));
|
||||
return _hasActiveInternetConnection(await (Connectivity().checkConnectivity()));
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isServerReachable(String serverAddress) async {
|
||||
try {
|
||||
final result = await InternetAddress.lookup(
|
||||
serverAddress.replaceAll(RegExp(r"https?://"), ""));
|
||||
var uri = Uri.parse(serverAddress);
|
||||
final result = await InternetAddress.lookup(uri.host);
|
||||
if (result.isNotEmpty && result.first.rawAddress.isNotEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user