Clear messages when navigating between projects

This commit is contained in:
Alex Gleason committed 2025-08-21 12:41:03 -05:00
1 parent ba1b08eab8
commit a0c3bf02ec
1 file changed
+13 -6
+13 -6
View File
@@ -153,14 +153,21 @@ BASE_DOMAIN=nostrdeploy.com`);
}
};
// Clear messages when navigating between projects
useEffect(() => {
setMessages([]);
}, [projectId])
useEffect(() => {
// Add welcome message
addMessage({
id: generateId(),
role: 'assistant',
content: `Hello! I'm here to help you build "${projectName}". I can help you edit files, add new features, and build your Nostr website. What would you like to work on?`,
});
}, [projectName, projectId]);
if (!messages.length) {
addMessage({
id: generateId(),
role: 'assistant',
content: `Hello! I'm here to help you build "${projectName}". I can help you edit files, add new features, and build your Nostr website. What would you like to work on?`,
});
}
}, [projectName, messages]);
useEffect(() => {
if (scrollAreaRef.current && messages) {