mirror of
https://github.com/desktop/desktop
synced 2024-09-13 05:11:21 +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