Skip to content

Commit 2d24187

Browse files
author
ClashFX Team
committed
fix: reset traffic stream on IP change for all websocket modes
Same gating bug as the wake-from-sleep handler: the IP-change subscription only reset the stream when a remote-control config was active, leaving local Enhanced Mode users with a stale websocket after Wi-Fi roaming or DHCP lease renewal. Switch the gate to !useDirectApi() so any websocket-mode user (TUN or external controller) gets a fresh stream when the primary IP changes.
1 parent 3dbeeb0 commit 2d24187

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ClashFX/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
582582
.notification(.systemNetworkStatusIPUpdate).map { _ in
583583
NetworkChangeNotifier.getPrimaryIPAddress(allowIPV6: false)
584584
}.bind { [weak self] _ in
585-
if RemoteControlManager.selectConfig != nil {
585+
if !ApiRequest.useDirectApi() {
586586
self?.resetStreamApi()
587587
}
588588
}.disposed(by: disposeBag)

0 commit comments

Comments
 (0)