diff --git a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart index 512b805..426eb9a 100644 --- a/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart +++ b/lib/pages/host_scan_page/host_scan_bloc/host_scan_bloc.dart @@ -49,15 +49,6 @@ class HostScanBloc extends Bloc { devicesSet.clear(); mDnsDevices.clear(); emit(const HostScanState.loadInProgress()); - await initializeWifiParameters(emit); - if (appSettings.runScanOnStartup) { - add(const HostScanEvent.loadScan()); - } else { - add(const HostScanEvent.startNewScan()); - } - } - - Future initializeWifiParameters(Emitter emit) async { String? wifiGatewayIP; try { wifiGatewayIP = await NetworkInfo().getWifiGatewayIP(); @@ -79,6 +70,11 @@ class HostScanBloc extends Bloc { return; } subnet = gatewayIp!.substring(0, gatewayIp!.lastIndexOf('.')); + if (appSettings.runScanOnStartup) { + add(const HostScanEvent.loadScan()); + } else { + add(const HostScanEvent.startNewScan()); + } } Future _startNewScanBuiltInIsolate(