1
0
Fork 0

Remove clear chat button

This commit is contained in:
Pabloader 2026-04-08 16:01:21 +00:00
parent 602abb1175
commit 37d48a4e8b
2 changed files with 0 additions and 16 deletions

View File

@ -361,15 +361,6 @@ export const ChatPanel = ({ visible }: { visible: boolean }) => {
}
};
const handleClear = () => {
if (!currentStory || !currentWorld) return;
dispatch({
type: 'CLEAR_CHAT',
worldId: currentWorld.id,
storyId: currentStory.id,
});
};
const handleDeleteMessage = useCallback((messageId: string) => {
if (!currentStory || !currentWorld) return;
dispatch({
@ -542,9 +533,6 @@ export const ChatPanel = ({ visible }: { visible: boolean }) => {
<div class={styles.errorText}>{error}</div>
</div>
)}
<button class={styles.clearButton} onClick={handleClear}>
Clear chat
</button>
</div>
)}
{currentStory && (

View File

@ -154,7 +154,6 @@ type Action =
| { type: 'SET_CHAT_OPEN'; open: boolean }
// Chat
| { type: 'ADD_CHAT_MESSAGE'; worldId: string; storyId: string; message: ChatMessage }
| { type: 'CLEAR_CHAT'; worldId: string; storyId: string }
| { type: 'DELETE_CHAT_MESSAGES_FROM'; worldId: string; storyId: string; messageId: string }
| { type: 'EDIT_CHAT_MESSAGE'; worldId: string; storyId: string; messageId: string; content: string }
// Connection
@ -440,9 +439,6 @@ function reducer(state: IState, action: Action): IState {
return { ...s, chatMessages: [...s.chatMessages, action.message] };
});
}
case 'CLEAR_CHAT': {
return updateStory(state, action.worldId, action.storyId, s => ({ ...s, chatMessages: [] }));
}
case 'DELETE_CHAT_MESSAGES_FROM': {
return updateStory(state, action.worldId, action.storyId, s => {
const messageIndex = s.chatMessages.findIndex(m => m.id === action.messageId);