code_review: PR #1412

- Use `ViewModels.StashesPage.SelectedStash` instead of `sender is not ListBox { SelectedValue: Models.Stash stash }`
- In tags view, `SelectedItem` can be `Models.Tag` or `ViewModels.TagTreeNode`
- In logs window, `vm.SelectedLog` may be null

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-11 16:13:47 +08:00
parent 196b454ae8
commit a128b67bd4
No known key found for this signature in database
10 changed files with 56 additions and 70 deletions

View file

@ -450,7 +450,7 @@ namespace SourceGit.Views
}
}
private void OnListKeyDown(object _, KeyEventArgs e)
private void OnTreeKeyDown(object _, KeyEventArgs e)
{
if (e.Key is not (Key.Delete or Key.Back))
return;
@ -463,7 +463,7 @@ namespace SourceGit.Views
if (selected == null || selected.Count == 0)
return;
if (selected is [ViewModels.BranchTreeNode { Backend: Models.Remote remote }])
if (selected.Count == 1 && selected[0] is ViewModels.BranchTreeNode { Backend: Models.Remote remote })
{
repo.DeleteRemote(remote);
e.Handled = true;