From 8b8e579bc8ee74513ba17a9347f908a7fee6394c Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 8 Sep 2026 20:32:26 +0800 Subject: [PATCH] Bug fix https://github.com/2dust/v2rayN/issues/10113 --- v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs | 7 +++++-- v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs | 13 ------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 98fbfd79..27aff8e0 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -695,7 +695,7 @@ public partial class MainWindowViewModel : MyReactiveObject { return; } - + await ProfilesViewModel.SetSpeedTestResult(new() { IndexId = profileItem.IndexId, @@ -739,7 +739,10 @@ public partial class MainWindowViewModel : MyReactiveObject RxSchedulers.MainThreadScheduler.Schedule(() => { ShowClashUI = showClashUI; - TabMainSelectedIndex = showClashUI ? TabMainSelectedIndex : 0; + if (!showClashUI || TabMainSelectedIndex < 0) + { + TabMainSelectedIndex = 0; + } }); } diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index b06a599f..bd2c7902 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -447,19 +447,6 @@ public partial class MainWindow : WindowBase break; } - //// workaround - //Task.Run(async () => - //{ - // await Task.Delay(5000); - // Dispatcher.UIThread.Post(() => - // { - // ViewModel?.TabMainSelectedIndex = 0; - // tabMain.SelectedIndex = 0; - // tabMain1.SelectedIndex = 0; - // tabMain2.SelectedIndex = 0; - // }); - //}); - RestoreUI(); }