ensure that the 'settings' object passed into JS is not empty

This commit is contained in:
辉鸭蛋
2024-11-10 13:22:56 +08:00
parent ef20a5448b
commit 648dfd3f41
2 changed files with 7 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ public partial class ScriptGroupProject : ObservableObject
{
throw new Exception("JS脚本未初始化");
}
JsScriptSettingsObject ??= new ExpandoObject();
await Project.ExecuteAsync(JsScriptSettingsObject);
}
if (Type == "KeyMouse")

View File

@@ -100,6 +100,12 @@ public partial class JsListViewModel : ObservableObject, INavigationAware, IView
return;
}
if (!string.IsNullOrEmpty(item.Manifest.SettingsUi))
{
Toast.Warning("此脚本存在配置,请添加至【调度器】,并右键修改配置后使用!");
return;
}
await _scriptService.RunMulti([new ScriptGroupProject(item)]);
}