|
|
@ -17,12 +17,10 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G |
|
|
|
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) { |
|
|
|
console.log(plugin.isGitRepo) |
|
|
|
|
|
|
|
setGitBranchName(workspace.name) |
|
|
|
setGitBranchName(workspace.name) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setGitBranchName('Not a git repo') |
|
|
|
setGitBranchName('Not a git repo') |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('setWorkspace on workspaceswitch',workspace) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
run() |
|
|
|
run() |
|
|
@ -33,18 +31,25 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G |
|
|
|
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) { |
|
|
|
console.log(plugin.isGitRepo) |
|
|
|
|
|
|
|
const workspace = localStorage.getItem('currentWorkspace') |
|
|
|
const workspace = localStorage.getItem('currentWorkspace') |
|
|
|
setGitBranchName(workspace) |
|
|
|
setGitBranchName(workspace) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setGitBranchName('Not a git repo') |
|
|
|
setGitBranchName('Not a git repo') |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('setWorkspace on workspaceswitch') |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
run() |
|
|
|
run() |
|
|
|
}, [gitBranchName, plugin.isGitRepo]) |
|
|
|
}, [gitBranchName, plugin.isGitRepo]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
const run = async () => { |
|
|
|
|
|
|
|
plugin.on('settings', 'copilotChoiceChanged', (isAiActive) => { |
|
|
|
|
|
|
|
console.log('copilot active', isAiActive) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
run() |
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
const lightDgitUp = async () => { |
|
|
|
const lightDgitUp = async () => { |
|
|
|
const isActive = await plugin.call('manager', 'isActive', 'dgit') |
|
|
|
const isActive = await plugin.call('manager', 'isActive', 'dgit') |
|
|
|
const isGit = await plugin.call('fileManager', 'isGitRepo') |
|
|
|
const isGit = await plugin.call('fileManager', 'isGitRepo') |
|
|
|