|
@@ -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();
|
|
|
}
|