Refactor History View's Context Menu

This commit is contained in:
uttiya10 2022-02-07 17:48:30 -05:00
parent cfd973f244
commit f4c4a045c8

View file

@ -368,6 +368,7 @@ export class SelectedCommit extends React.Component<
label: CopyRelativeFilePathLabel,
action: () => clipboard.writeText(Path.normalize(file.path)),
},
{ type: 'separator' },
]
let viewOnGitHubLabel = 'View on GitHub'
@ -380,17 +381,14 @@ export class SelectedCommit extends React.Component<
viewOnGitHubLabel = 'View on GitHub Enterprise'
}
items.push(
{ type: 'separator' },
{
label: viewOnGitHubLabel,
action: () => this.onViewOnGitHub(file),
enabled:
!this.props.isLocal &&
!!gitHubRepository &&
!!this.props.selectedCommit,
}
)
items.push({
label: viewOnGitHubLabel,
action: () => this.onViewOnGitHub(file),
enabled:
!this.props.isLocal &&
!!gitHubRepository &&
!!this.props.selectedCommit,
})
showContextualMenu(items)
}