mirror of
https://github.com/2dust/v2rayN.git
synced 2025-11-12 18:32:52 +00:00
Bug fix
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
Replaced direct assignments to BlReloadEnabled with a new SetReloadEnabled method that schedules updates on the main thread.
This commit is contained in:
parent
69797c10f2
commit
32583ea8b3
1 changed files with 15 additions and 9 deletions
|
|
@ -268,7 +268,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
}
|
||||
await RefreshServers();
|
||||
|
||||
BlReloadEnabled = true;
|
||||
SetReloadEnabled(true);
|
||||
await Reload();
|
||||
}
|
||||
|
||||
|
|
@ -534,7 +534,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
return;
|
||||
}
|
||||
|
||||
BlReloadEnabled = false;
|
||||
SetReloadEnabled(false);
|
||||
|
||||
var msgs = await ActionPrecheckManager.Instance.Check(_config.IndexId);
|
||||
if (msgs.Count > 0)
|
||||
|
|
@ -544,7 +544,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
NoticeManager.Instance.SendMessage(msg);
|
||||
}
|
||||
NoticeManager.Instance.Enqueue(Utils.List2String(msgs.Take(10).ToList(), true));
|
||||
BlReloadEnabled = true;
|
||||
SetReloadEnabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -562,9 +562,8 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
AppEvents.ProxiesReloadRequested.Publish();
|
||||
}
|
||||
|
||||
RxApp.MainThreadScheduler.Schedule(() => ReloadResult(showClashUI));
|
||||
|
||||
BlReloadEnabled = true;
|
||||
ReloadResult(showClashUI);
|
||||
SetReloadEnabled(true);
|
||||
if (_hasNextReloadJob)
|
||||
{
|
||||
_hasNextReloadJob = false;
|
||||
|
|
@ -574,9 +573,16 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
|
||||
private void ReloadResult(bool showClashUI)
|
||||
{
|
||||
// BlReloadEnabled = true;
|
||||
RxApp.MainThreadScheduler.Schedule(() =>
|
||||
{
|
||||
ShowClashUI = showClashUI;
|
||||
TabMainSelectedIndex = showClashUI ? TabMainSelectedIndex : 0;
|
||||
});
|
||||
}
|
||||
|
||||
private void SetReloadEnabled(bool enabled)
|
||||
{
|
||||
RxApp.MainThreadScheduler.Schedule(() => BlReloadEnabled = enabled);
|
||||
}
|
||||
|
||||
private async Task LoadCore()
|
||||
|
|
|
|||
Loading…
Reference in a new issue