|
|
@ -50,7 +50,6 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
const [needsInit, setNeedsInit] = useState<boolean>(true) |
|
|
|
const [needsInit, setNeedsInit] = useState<boolean>(true) |
|
|
|
const [appLoaded, setAppLoaded] = useState<boolean>(false) |
|
|
|
const [appLoaded, setAppLoaded] = useState<boolean>(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
plugin.emit('statusChanged', { |
|
|
|
plugin.emit('statusChanged', { |
|
|
|
key:'loading', |
|
|
|
key:'loading', |
|
|
@ -63,7 +62,7 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
},[]) |
|
|
|
},[]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(!appLoaded) return |
|
|
|
if (!appLoaded) return |
|
|
|
setCallBacks(plugin, gitDispatch, loaderDispatch) |
|
|
|
setCallBacks(plugin, gitDispatch, loaderDispatch) |
|
|
|
setPlugin(plugin, gitDispatch, loaderDispatch) |
|
|
|
setPlugin(plugin, gitDispatch, loaderDispatch) |
|
|
|
loaderDispatch({ type: 'plugin', payload: true }) |
|
|
|
loaderDispatch({ type: 'plugin', payload: true }) |
|
|
@ -71,7 +70,7 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
}, [appLoaded]) |
|
|
|
}, [appLoaded]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(!appLoaded) return |
|
|
|
if (!appLoaded) return |
|
|
|
async function checkconfig() { |
|
|
|
async function checkconfig() { |
|
|
|
|
|
|
|
|
|
|
|
const username = await plugin.call('settings', 'get', 'settings/github-user-name') |
|
|
|
const username = await plugin.call('settings', 'get', 'settings/github-user-name') |
|
|
@ -84,7 +83,7 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
}, [gitState.gitHubAccessToken, gitState.gitHubUser, gitState.userEmails]) |
|
|
|
}, [gitState.gitHubAccessToken, gitState.gitHubUser, gitState.userEmails]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(!appLoaded) return |
|
|
|
if (!appLoaded) return |
|
|
|
async function setDecorators(gitState: gitState) { |
|
|
|
async function setDecorators(gitState: gitState) { |
|
|
|
await plugin.call('fileDecorator', 'clearFileDecorators') |
|
|
|
await plugin.call('fileDecorator', 'clearFileDecorators') |
|
|
|
await setModifiedDecorator(gitState.modified) |
|
|
|
await setModifiedDecorator(gitState.modified) |
|
|
@ -98,7 +97,7 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
}, [gitState.fileStatusResult]) |
|
|
|
}, [gitState.fileStatusResult]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(!appLoaded) return |
|
|
|
if (!appLoaded) return |
|
|
|
async function updatestate() { |
|
|
|
async function updatestate() { |
|
|
|
console.log('updatestate', gitState) |
|
|
|
console.log('updatestate', gitState) |
|
|
|
if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) { |
|
|
|
if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) { |
|
|
@ -113,7 +112,6 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
|
|
|
|
|
|
|
|
}, [gitState.gitHubUser, gitState.currentBranch, gitState.remotes, gitState.gitHubAccessToken]) |
|
|
|
}, [gitState.gitHubUser, gitState.currentBranch, gitState.remotes, gitState.gitHubAccessToken]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const gitActionsProviderValue = { |
|
|
|
const gitActionsProviderValue = { |
|
|
|
commit, |
|
|
|
commit, |
|
|
|
addall, |
|
|
|
addall, |
|
|
|