mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 06:58:51 +08:00
feat: sync project name with selected folder
This commit is contained in:
@@ -179,6 +179,11 @@ async function handlePickWorkspaceDirectory() {
|
||||
const selectedPath = await pickDirectory(form.value.workspace_path || null);
|
||||
if (selectedPath) {
|
||||
form.value.workspace_path = selectedPath;
|
||||
const normalizedPath = selectedPath.replace(/[\\/]+$/, '');
|
||||
const folderName = normalizedPath.split(/[\\/]/).pop();
|
||||
if (folderName) {
|
||||
form.value.title = folderName;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('[chat-project] Failed to pick workspace directory.', error);
|
||||
|
||||
Reference in New Issue
Block a user