fix(vscode): add project adds the chosen folder to the workspace
This commit is contained in:
@@ -417,11 +417,11 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
|
||||
handleClose();
|
||||
}, [handleClose, isMobile, openNewSessionDraft, setActiveMainTab, setSessionSwitcherOpen]);
|
||||
|
||||
const handleQuickAdd = React.useCallback((event: React.MouseEvent, path: string) => {
|
||||
const handleQuickAdd = React.useCallback(async (event: React.MouseEvent, path: string) => {
|
||||
event.stopPropagation();
|
||||
const normalized = normalizeDirectoryPath(path);
|
||||
if (normalized && addedProjectPaths.has(normalized)) return;
|
||||
const project = addProject(path);
|
||||
const project = await addProject(path);
|
||||
if (!project) {
|
||||
toast.error(t('directoryExplorerDialog.toast.failedToAddProject'), {
|
||||
description: t('directoryExplorerDialog.toast.selectValidDirectoryPath'),
|
||||
@@ -455,7 +455,7 @@ export const DirectoryExplorerDialog: React.FC<DirectoryExplorerDialogProps> = (
|
||||
} else if (shouldCreateSelection) {
|
||||
await opencodeClient.createDirectory(target, { asProject: true });
|
||||
}
|
||||
const project = addProject(selectedTarget);
|
||||
const project = await addProject(selectedTarget);
|
||||
if (!project) {
|
||||
toast.error(t('directoryExplorerDialog.toast.failedToAddProject'), {
|
||||
description: t('directoryExplorerDialog.toast.selectValidDirectoryPath'),
|
||||
|
||||
Reference in New Issue
Block a user