mirror of
https://github.com/2dust/v2rayN.git
synced 2025-12-10 05:19:42 +05:00
Bug fix
Replaced direct assignments to BlReloadEnabled with a new SetReloadEnabled method that schedules updates on the main thread.
This commit is contained in:
@@ -268,7 +268,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||||||
}
|
}
|
||||||
await RefreshServers();
|
await RefreshServers();
|
||||||
|
|
||||||
BlReloadEnabled = true;
|
SetReloadEnabled(true);
|
||||||
await Reload();
|
await Reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -534,7 +534,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlReloadEnabled = false;
|
SetReloadEnabled(false);
|
||||||
|
|
||||||
var msgs = await ActionPrecheckManager.Instance.Check(_config.IndexId);
|
var msgs = await ActionPrecheckManager.Instance.Check(_config.IndexId);
|
||||||
if (msgs.Count > 0)
|
if (msgs.Count > 0)
|
||||||
@@ -544,7 +544,7 @@ public class MainWindowViewModel : MyReactiveObject
|
|||||||
NoticeManager.Instance.SendMessage(msg);
|
NoticeManager.Instance.SendMessage(msg);
|
||||||
}
|
}
|
||||||
NoticeManager.Instance.Enqueue(Utils.List2String(msgs.Take(10).ToList(), true));
|
NoticeManager.Instance.Enqueue(Utils.List2String(msgs.Take(10).ToList(), true));
|
||||||
BlReloadEnabled = true;
|
SetReloadEnabled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,9 +562,8 @@ public class MainWindowViewModel : MyReactiveObject
|
|||||||
AppEvents.ProxiesReloadRequested.Publish();
|
AppEvents.ProxiesReloadRequested.Publish();
|
||||||
}
|
}
|
||||||
|
|
||||||
RxApp.MainThreadScheduler.Schedule(() => ReloadResult(showClashUI));
|
ReloadResult(showClashUI);
|
||||||
|
SetReloadEnabled(true);
|
||||||
BlReloadEnabled = true;
|
|
||||||
if (_hasNextReloadJob)
|
if (_hasNextReloadJob)
|
||||||
{
|
{
|
||||||
_hasNextReloadJob = false;
|
_hasNextReloadJob = false;
|
||||||
@@ -574,9 +573,16 @@ public class MainWindowViewModel : MyReactiveObject
|
|||||||
|
|
||||||
private void ReloadResult(bool showClashUI)
|
private void ReloadResult(bool showClashUI)
|
||||||
{
|
{
|
||||||
// BlReloadEnabled = true;
|
RxApp.MainThreadScheduler.Schedule(() =>
|
||||||
|
{
|
||||||
ShowClashUI = showClashUI;
|
ShowClashUI = showClashUI;
|
||||||
TabMainSelectedIndex = showClashUI ? TabMainSelectedIndex : 0;
|
TabMainSelectedIndex = showClashUI ? TabMainSelectedIndex : 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetReloadEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
RxApp.MainThreadScheduler.Schedule(() => BlReloadEnabled = enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadCore()
|
private async Task LoadCore()
|
||||||
|
|||||||
Reference in New Issue
Block a user