code_style: add ViewModels.Repository.GetCustomAction(scope)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-10 21:30:04 +08:00
parent 5c279b4b56
commit cf8cff6b64
No known key found for this signature in database
2 changed files with 22 additions and 37 deletions

View file

@ -694,17 +694,7 @@ namespace SourceGit.ViewModels
menu.Items.Add(archive);
menu.Items.Add(new MenuItem() { Header = "-" });
var actions = new List<Models.CustomAction>();
foreach (var action in Preferences.Instance.CustomActions)
{
if (action.Scope == Models.CustomActionScope.Commit)
actions.Add(action);
}
foreach (var action in _repo.Settings.CustomActions)
{
if (action.Scope == Models.CustomActionScope.Commit)
actions.Add(action);
}
var actions = _repo.GetCustomActions(Models.CustomActionScope.Commit);
if (actions.Count > 0)
{
var custom = new MenuItem();