From 708b4c7646748c5b41c3168f567c46565e37f36a Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Sun, 8 Dec 2024 15:05:48 -0500 Subject: [PATCH] fix: auto tunnel wifi whitelist bug #472 --- .../service/foreground/autotunnel/AutoTunnelService.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/autotunnel/AutoTunnelService.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/autotunnel/AutoTunnelService.kt index a9e93b7..6e71b3f 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/autotunnel/AutoTunnelService.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/autotunnel/AutoTunnelService.kt @@ -41,6 +41,8 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.filter +import kotlinx.coroutines.flow.filterNot import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @@ -259,7 +261,7 @@ class AutoTunnelService : LifecycleService() { is NetworkStatus.Unavailable -> null }, ) - }.distinctUntilChanged() + }.distinctUntilChanged().filterNot { it.isWifiConnected && it.wifiName == null } } private fun combineSettings(): Flow> {