mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Clear messages when navigating between projects
This commit is contained in:
1 parent
2fd4bb52d3
commit
9f213ffa79
1 file changed
+13
-6
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user