fix ts error
This commit is contained in:
@ -11,7 +11,7 @@ interface ProjectNameEditorProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ProjectNameEditor({ className }: ProjectNameEditorProps) {
|
export function ProjectNameEditor({ className }: ProjectNameEditorProps) {
|
||||||
const { activeProject, updateProjectName } = useProjectStore();
|
const { activeProject, renameProject } = useProjectStore();
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [editValue, setEditValue] = useState("");
|
const [editValue, setEditValue] = useState("");
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
@ -37,8 +37,8 @@ export function ProjectNameEditor({ className }: ProjectNameEditorProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
if (editValue.trim()) {
|
if (editValue.trim() && activeProject) {
|
||||||
updateProjectName(editValue.trim());
|
renameProject(activeProject.id, editValue.trim());
|
||||||
setIsEditing(false);
|
setIsEditing(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user