git4refactor
filip mertens 9 months ago
parent 63c15f03d6
commit 88cef7b6bf
  1. 14
      libs/remix-ui/git/src/components/gitui.tsx

@ -1,5 +1,5 @@
import React, { useEffect, useReducer, useState } from 'react' import React, { useEffect, useReducer, useState } from 'react'
import { add, addall, checkout, checkoutfile, clone, commit, createBranch, remoteBranches, repositories, rm, getCommitChanges, diff, resolveRef, getBranchCommits, setUpstreamRemote, getGitHubUser, getBranches, getRemotes, remoteCommits } from '../lib/gitactions' import { add, addall, checkout, checkoutfile, clone, commit, createBranch, remoteBranches, repositories, rm, getCommitChanges, diff, resolveRef, getBranchCommits, setUpstreamRemote, getGitHubUser, getBranches, getRemotes, remoteCommits, saveGitHubCredentials, getGitHubCredentials, fetch, pull, push } from '../lib/gitactions'
import { loadFiles, setCallBacks } from '../lib/listeners' import { loadFiles, setCallBacks } from '../lib/listeners'
import { openDiff, openFile, saveToken, setModifiedDecorator, setPlugin, setUntrackedDecorator, statusChanged } from '../lib/pluginActions' import { openDiff, openFile, saveToken, setModifiedDecorator, setPlugin, setUntrackedDecorator, statusChanged } from '../lib/pluginActions'
import { gitActionsContext, pluginActionsContext } from '../state/context' import { gitActionsContext, pluginActionsContext } from '../state/context'
@ -45,6 +45,7 @@ export const GitUI = (props: IGitUi) => {
useEffect(() => { useEffect(() => {
setCallBacks(plugin, gitDispatch, loaderDispatch) setCallBacks(plugin, gitDispatch, loaderDispatch)
setPlugin(plugin, gitDispatch, loaderDispatch) setPlugin(plugin, gitDispatch, loaderDispatch)
loaderDispatch({ type: 'plugin', payload: true })
console.log(props) console.log(props)
}, []) }, [])
@ -71,7 +72,7 @@ export const GitUI = (props: IGitUi) => {
async function updatestate(){ async function updatestate(){
console.log('updatestate', gitState) console.log('updatestate', gitState)
if(gitState.currentBranch.remote.url){ if(gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url){
remoteCommits(gitState.currentBranch.remote.url, gitState.currentBranch.name, 1) remoteCommits(gitState.currentBranch.remote.url, gitState.currentBranch.name, 1)
} }
} }
@ -100,7 +101,10 @@ export const GitUI = (props: IGitUi) => {
setUpstreamRemote, setUpstreamRemote,
getGitHubUser, getGitHubUser,
getBranches, getBranches,
getRemotes getRemotes,
fetch,
pull,
push
} }
const pluginActionsProviderValue = { const pluginActionsProviderValue = {
@ -108,7 +112,9 @@ export const GitUI = (props: IGitUi) => {
loadFiles, loadFiles,
openFile, openFile,
openDiff, openDiff,
saveToken saveToken,
saveGitHubCredentials,
getGitHubCredentials
} }
return ( return (

Loading…
Cancel
Save