From 2e60fb3689a345549ceabb7e3750b7e59eed2387 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:22:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(wpf):=20=E4=BF=AE=E6=94=B9=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=90=8D=E8=BF=87=E6=BB=A4=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index 8046ac8ef6..2bc9116edb 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -1319,7 +1319,7 @@ public class TaskQueueViewModel : Screen } var taskType = ConfigFactory.CurrentConfig.TaskQueue[taskItem.Index].TaskType; - var currentName = taskItem.Name; + var currentName = taskItem.Name.Replace("\r", string.Empty).Replace("\n", string.Empty); var dialog = new Views.Dialogs.TextDialogUserControl( LocalizationHelper.GetString("RenameTask") + $" {taskItem.Index + 1}-{LocalizationHelper.GetString(taskType.ToString())}", LocalizationHelper.GetString("RenameTaskPrompt"), @@ -1331,7 +1331,7 @@ public class TaskQueueViewModel : Screen if (result == true && !string.IsNullOrWhiteSpace(dialog.InputText)) { - var newName = dialog.InputText.Trim(); + var newName = dialog.InputText.Trim().Replace("\r", string.Empty).Replace("\n", string.Empty); taskItem.Name = newName; if (taskItem.Index < ConfigFactory.CurrentConfig.TaskQueue.Count) {