Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 77df3fa

Browse files
Removing the selected node on delete
1 parent b00cf5e commit 77df3fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public override void OnDisable()
6161
{
6262
base.OnDisable();
6363
DetachHandlers(Repository);
64+
selectedNode = null;
6465
}
6566

6667
public override void OnRepositoryChanged(IRepository oldRepository)
@@ -461,7 +462,7 @@ private void OnButtonBarGUI()
461462
{
462463
// Delete button
463464
// If the current branch is selected, then do not enable the Delete button
464-
var disableDelete = activeBranchNode == selectedNode;
465+
var disableDelete = selectedNode == null || activeBranchNode == selectedNode;
465466
EditorGUI.BeginDisabledGroup(disableDelete);
466467
{
467468
if (GUILayout.Button(DeleteBranchButton, EditorStyles.miniButton, GUILayout.ExpandWidth(false)))

0 commit comments

Comments
 (0)