1. 删除了 _kr_handleSelectorProxy 中会导致死循环的重选逻辑
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled

2. 简化了 _kr_handleManualMode,只更新 UI 不触发重选
This commit is contained in:
speakeloudest 2025-11-03 00:48:15 -08:00
parent c7b77c1ad8
commit 1a9f0d79ac
2 changed files with 20 additions and 44 deletions

View File

@ -29,14 +29,15 @@ class HINodeListView extends GetView<HINodeListController> {
///
int _getDisplayDelay(HINodeListController controller, KROutboundItem item) {
if (controller.homeController.kr_isConnected.value) {
return item.urlTestDelay.value;
}
if (!_fakeDelays.containsKey(item.tag)) {
final random = Random();
_fakeDelays[item.tag] = 30 + random.nextInt(71); // 30-100ms
}
return _fakeDelays[item.tag] ?? 0;
// if (controller.homeController.kr_isConnected.value) {
//
// }
// if (!_fakeDelays.containsKey(item.tag)) {
// final random = Random();
// _fakeDelays[item.tag] = 30 + random.nextInt(71); // 30-100ms
// }
// return _fakeDelays[item.tag] ?? 0;
}
/// ms

View File

@ -762,24 +762,11 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
.value}',
tag: 'HomeController');
// auto但实际select类型不是auto
if (kr_cutTag.value == "auto" && element.selected != "auto") {
KRLogUtil.kr_d(
'用户选择了auto但实际不是auto重新选择auto', tag: 'HomeController');
KRSingBoxImp.instance.kr_selectOutbound("auto");
_kr_handleAutoMode(element, allGroups);
return;
}
// select类型不是该节点
if (kr_cutTag.value != "auto" && element.selected != kr_cutTag.value) {
KRLogUtil.kr_d(
'用户选择了${kr_cutTag.value}但实际是${element.selected},更新选择',
tag: 'HomeController');
kr_selectNode(kr_cutTag.value);
return;
// 🔧 UI
// kr_cutSeletedTag
if (element.selected.isNotEmpty) {
kr_cutSeletedTag.value = element.selected;
}
// auto
@ -801,25 +788,13 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
KRLogUtil.kr_d(
'处理手动模式 - 选择: ${element.selected}', tag: 'HomeController');
//
if (kr_cutTag.value != element.selected) {
//
if (_kr_isValidLatency(kr_cutTag.value)) {
kr_selectNode(kr_cutTag.value);
//
_kr_updateNodeLatency(element);
} else {
//
_kr_selectBestLatencyNode(element.items);
}
} else {
// 🔧 UI
kr_cutSeletedTag.value = element.selected;
//
_kr_updateNodeLatency(element);
kr_currentNodeName.value =
kr_truncateText(element.selected, maxLength: 25);
// kr_moveToSelectedNode();
}
} catch (e) {
KRLogUtil.kr_e('处理手动模式出错: $e', tag: 'HomeController');
}