mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
Allow project name to have spaces (#1503)
This commit is contained in:
parent
9ee7b7ac43
commit
41edb07a5d
1 changed files with 7 additions and 2 deletions
|
|
@ -64,8 +64,8 @@ function AddProjectModalContent({ initialProject, onSave, onCancel }: AddProject
|
|||
setFormData((prev) => {
|
||||
// Handle text input
|
||||
if (typeof value === "string") {
|
||||
// Only trim for specific fields that shouldn't have whitespace
|
||||
if (field === "name" || field === "projectModelKey") {
|
||||
// Only trim for model key which shouldn't have whitespace
|
||||
if (field === "projectModelKey") {
|
||||
value = value.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -97,6 +97,11 @@ function AddProjectModalContent({ initialProject, onSave, onCancel }: AddProject
|
|||
};
|
||||
|
||||
const handleSave = async () => {
|
||||
// Trim the project name before validation and saving
|
||||
if (formData.name) {
|
||||
formData.name = formData.name.trim();
|
||||
}
|
||||
|
||||
const requiredFields = ["name", "projectModelKey"];
|
||||
const missingFields = requiredFields.filter((field) => !formData[field as keyof ProjectConfig]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue