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

@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react'
export const Disabled = () => {
return (
<div data-id='disabled' className='text-sm w-100 alert alert-warning'>
return (
<div data-id='disabled' className='text-sm w-100 alert alert-warning'>
Git is currently disabled.<br></br>
If you are using RemixD you can use git on the terminal.<br></br>
</div>
)
</div>
)
}

@ -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