修复JS脚本选择窗口的对话框结果处理,确保正确获取用户选择的脚本

This commit is contained in:
辉鸭蛋
2025-09-07 08:46:44 +08:00
parent 109fee5588
commit 459a1b1468

View File

@@ -339,7 +339,9 @@ public partial class GearTaskListPageViewModel : ViewModel
Owner = Application.Current.MainWindow
};
if (jsSelectionWindow.ShowDialog() == true && jsSelectionWindow.ViewModel.SelectedScript != null)
jsSelectionWindow.ShowDialog();
if (jsSelectionWindow.DialogResult && jsSelectionWindow.ViewModel.SelectedScript != null)
{
var selectedScript = jsSelectionWindow.ViewModel.SelectedScript;
newTask = new GearTaskViewModel(selectedScript.DisplayName)