[mob] Log n/w when mobileBackUpIsDisabled and backup is happening (#1589)

## Description

## Tests
This commit is contained in:
Neeraj Gupta 2024-05-03 10:34:34 +05:30 committed by GitHub
commit 486d89f506
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -357,10 +357,16 @@ class FileUploader {
final List<ConnectivityResult> connections =
await (Connectivity().checkConnectivity());
bool canUploadUnderCurrentNetworkConditions = true;
if (connections.any((element) => element == ConnectivityResult.mobile)) {
canUploadUnderCurrentNetworkConditions =
Configuration.instance.shouldBackupOverMobileData();
if (!Configuration.instance.shouldBackupOverMobileData()) {
if (connections.any((element) => element == ConnectivityResult.mobile)) {
canUploadUnderCurrentNetworkConditions = false;
} else {
_logger.info(
"mobileBackupDisabled, backing up with connections: ${connections.map((e) => e.name).toString()}",
);
}
}
if (!canUploadUnderCurrentNetworkConditions) {
throw WiFiUnavailableError();
}