Skip to content

Commit cf1d272

Browse files
committed
fixes #214 correct Wi-Fi check condition to prevent false modal display on upload
The previous condition used `!= ConnectivityResult.wifi`, which failed when the result was a list of connections (e.g., multiple active interfaces). Now uses `.contains()` to ensure Wi-Fi is truly absent before showing the modal.
1 parent fc6cacb commit cf1d272

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/network/upload.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Future<List<int>> uploadPhotos(
6464
// Check if Wifi is enabled and working before processing
6565
if (Preferences.getWifiUpload) {
6666
var connectivity = await Connectivity().checkConnectivity();
67-
if (connectivity != ConnectivityResult.wifi) {
67+
if (!connectivity.contains(ConnectivityResult.wifi)) {
6868
if (!(await showConfirmDialog(
6969
App.navigatorKey.currentContext!,
7070
title: appStrings.uploadNoWiFiNetwork,

0 commit comments

Comments
 (0)