Duplicate first message
This commit is contained in:
parent
21ad47a67b
commit
24165f0abd
|
|
@ -337,6 +337,8 @@ function reducer(state: IState, action: Action): IState {
|
|||
const world = state.worlds.find(w => w.id === action.worldId);
|
||||
const original = world?.stories.find(s => s.id === action.id);
|
||||
if (!original) return state;
|
||||
const firstMessage = original.chatMessages[0];
|
||||
const chatMessages = world?.chatOnly && firstMessage && firstMessage.role === 'assistant' ? [firstMessage] : [];
|
||||
const newStory: Story = {
|
||||
id: crypto.randomUUID(),
|
||||
title: `${original.title} (Copy)`,
|
||||
|
|
@ -345,7 +347,7 @@ function reducer(state: IState, action: Action): IState {
|
|||
lore: [...original.lore],
|
||||
characters: [...original.characters],
|
||||
locations: [...original.locations],
|
||||
chatMessages: [],
|
||||
chatMessages,
|
||||
chapters: [],
|
||||
};
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in New Issue