Merge pull request #404 from devchat-ai/bugfix/commands-not-visible-#156

Fix: Command list not displaying due to async/await issues
This commit is contained in:
boob.yang 2024-01-09 08:56:55 +08:00 committed by GitHub
commit 30f4880fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View File

@ -288,16 +288,11 @@ export function registerInstallCommandsCommand(context: vscode.ExtensionContext)
sendCommandListByDevChatRun();
} else {
// Directory exists, execute sendCommandListByDevChatRun immediately
sendCommandListByDevChatRun();
await sendCommandListByDevChatRun();
// Then asynchronously execute updateSysCommand
devchat.updateSysCommand().then(() => {
// After updateSysCommand finishes, execute sendCommandListByDevChatRun again
sendCommandListByDevChatRun();
}).catch((error) => {
// Handle any errors that occur during updateSysCommand
console.error('Error updating sys command:', error);
});
await devchat.updateSysCommand();
await sendCommandListByDevChatRun();
}
});

View File

@ -56,7 +56,7 @@ export async function getWorkflowCommandList(message: any, panel: vscode.Webview
export async function sendCommandListByDevChatRun() {
if (existPannel) {
getWorkflowCommandList({}, existPannel!);
await getWorkflowCommandList({}, existPannel!);
}
}