|
|
|
@ -48,15 +48,30 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
|
const [activePanel, setActivePanel] = useState<string>("0") |
|
|
|
|
const [setup, setSetup] = useState<boolean>(false) |
|
|
|
|
const [needsInit, setNeedsInit] = useState<boolean>(true) |
|
|
|
|
const [appLoaded, setAppLoaded] = useState<boolean>(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
plugin.emit('statusChanged', { |
|
|
|
|
key:'loading', |
|
|
|
|
type: 'info', |
|
|
|
|
title: 'Loading Git Plugin' |
|
|
|
|
}) |
|
|
|
|
setTimeout(() => { |
|
|
|
|
setAppLoaded(true) |
|
|
|
|
}, 2000) |
|
|
|
|
},[]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(!appLoaded) return |
|
|
|
|
setCallBacks(plugin, gitDispatch, loaderDispatch) |
|
|
|
|
setPlugin(plugin, gitDispatch, loaderDispatch) |
|
|
|
|
loaderDispatch({ type: 'plugin', payload: true }) |
|
|
|
|
console.log(props) |
|
|
|
|
}, []) |
|
|
|
|
}, [appLoaded]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(!appLoaded) return |
|
|
|
|
async function checkconfig() { |
|
|
|
|
|
|
|
|
|
const username = await plugin.call('settings', 'get', 'settings/github-user-name') |
|
|
|
@ -69,7 +84,7 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
|
}, [gitState.gitHubAccessToken, gitState.gitHubUser, gitState.userEmails]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
|
if(!appLoaded) return |
|
|
|
|
async function setDecorators(gitState: gitState) { |
|
|
|
|
await plugin.call('fileDecorator', 'clearFileDecorators') |
|
|
|
|
await setModifiedDecorator(gitState.modified) |
|
|
|
@ -83,7 +98,7 @@ export const GitUI = (props: IGitUi) => { |
|
|
|
|
}, [gitState.fileStatusResult]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
|
if(!appLoaded) return |
|
|
|
|
async function updatestate() { |
|
|
|
|
console.log('updatestate', gitState) |
|
|
|
|
if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) { |
|
|
|
|