pull/4791/head
bunsenstraat 5 months ago
parent 0af14a0b8f
commit 537026cdf2
  1. 2
      libs/remix-ui/git/src/components/gitui.tsx
  2. 8
      libs/remix-ui/git/src/components/panels/commands/pushpull.tsx

@ -162,8 +162,6 @@ export const GitUI = (props: IGitUi) => {
showAlert
}
return (
<>{(!gitState.canUseApp) ? <Disabled></Disabled> :
<div className="m-1">

@ -15,6 +15,7 @@ export const PushPull = () => {
const [localBranchOptions, setLocalBranchOptions] = useState<any>([]);
const [remoteBranchOptions, setRemoteBranchOptions] = useState<any>([]);
const [localRemotesOptions, setLocalRemotesOptions] = useState<any>([]);
const [disabled, setDisabled] = useState(false)
const [force, setForce] = useState(false)
useEffect(() => {
@ -25,11 +26,14 @@ export const PushPull = () => {
if (!context.upstream || !currentUpstreamIsInRemotes) {
if (context.currentBranch && context.currentBranch.remote && context.currentBranch.remote.name) {
actions.setUpstreamRemote(context.currentBranch.remote)
setDisabled(false)
} else {
if (context.remotes && context.remotes.length > 0) {
actions.setUpstreamRemote(context.remotes[0])
setDisabled(false)
} else {
actions.setUpstreamRemote(null)
setDisabled(true)
}
}
}
@ -136,7 +140,9 @@ export const PushPull = () => {
return (
<>
{disabled? <div data-id='disabled' className='text-sm w-100 alert alert-warning mt-1'>
You cannot push or pull because you haven't connected to or selected a remote.
</div>: null}
<div className="btn-group w-100 mt-2" role="group">
<GitUIButton data-id='sourcecontrol-pull' disabledCondition={pushPullIsDisabled()} type="button" onClick={async () => pull()} className="btn btn-primary mr-1">Pull</GitUIButton>

Loading…
Cancel
Save