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(); }