From cb331b653c788c6eb4fed0a3ce39cda830122a48 Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:21:29 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=9C=A8=20ui=20=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs | 2 +- src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs index 2d4c186dc8..673061a04c 100644 --- a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs @@ -157,7 +157,7 @@ namespace MaaWpfGui.ViewModels.UI /// private void ClearLog() { - LogItemViewModels.Clear(); + Execute.OnUIThread(() => LogItemViewModels.Clear()); } private string _filename = string.Empty; diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index d875c9cc73..0c97db6a43 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -802,9 +802,12 @@ namespace MaaWpfGui.ViewModels.UI /// private void ClearLog() { + Execute.OnUIThread(() => + { LogItemViewModels.Clear(); _logger.Information("Main windows log clear."); _logger.Information(string.Empty); + }); } ///