fix updating git status

pull/4896/head
yann300 5 months ago committed by Aniket
parent e381c09e33
commit e841860c17
  1. 17
      libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx

@ -13,7 +13,6 @@ export interface GitStatusProps {
export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: GitStatusProps) { export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: GitStatusProps) {
useEffect(() => { useEffect(() => {
const run = async () => {
plugin.on('filePanel', 'setWorkspace', async (workspace) => { plugin.on('filePanel', 'setWorkspace', async (workspace) => {
const isGit = await plugin.call('fileManager', 'isGitRepo') const isGit = await plugin.call('fileManager', 'isGitRepo')
if (isGit) { if (isGit) {
@ -22,12 +21,6 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G
setGitBranchName('Not a git repo') setGitBranchName('Not a git repo')
} }
}) })
}
run()
}, [gitBranchName, plugin.isGitRepo])
useEffect(() => {
const run = async () => {
plugin.on('filePanel', 'workspaceInitializationCompleted', async () => { plugin.on('filePanel', 'workspaceInitializationCompleted', async () => {
const isGit = await plugin.call('fileManager', 'isGitRepo') const isGit = await plugin.call('fileManager', 'isGitRepo')
if (isGit) { if (isGit) {
@ -37,12 +30,6 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G
setGitBranchName('Not a git repo') setGitBranchName('Not a git repo')
} }
}) })
}
run()
}, [gitBranchName, plugin.isGitRepo])
useEffect(() => {
const run = async () => {
plugin.on('dGitProvider', 'init', async () => { plugin.on('dGitProvider', 'init', async () => {
const isGit = await plugin.call('fileManager', 'isGitRepo') const isGit = await plugin.call('fileManager', 'isGitRepo')
if (isGit) { if (isGit) {
@ -50,9 +37,7 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G
setGitBranchName(workspace) setGitBranchName(workspace)
} }
}) })
} }, [])
run()
}, [gitBranchName, plugin.isGitRepo])
const lightDgitUp = async () => { const lightDgitUp = async () => {
const isActive = await plugin.call('manager', 'isActive', 'dgit') const isActive = await plugin.call('manager', 'isActive', 'dgit')

Loading…
Cancel
Save