diff --git a/libs/remix-ui/git/src/components/gitui.tsx b/libs/remix-ui/git/src/components/gitui.tsx index 0539266d8d..3d4518e266 100644 --- a/libs/remix-ui/git/src/components/gitui.tsx +++ b/libs/remix-ui/git/src/components/gitui.tsx @@ -48,17 +48,32 @@ export const GitUI = (props: IGitUi) => { const [activePanel, setActivePanel] = useState("0") const [setup, setSetup] = useState(false) const [needsInit, setNeedsInit] = useState(true) + const [appLoaded, setAppLoaded] = useState(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') const email = await plugin.call('settings', 'get', 'settings/github-email') const token = await plugin.call('settings', 'get', 'settings/gist-access-token') @@ -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) {