mirror of
https://github.com/desktop/desktop
synced 2024-08-25 03:07:41 +00:00
Refactor History View's Context Menu
This commit is contained in:
parent
cfd973f244
commit
f4c4a045c8
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue