From 24165f0abdd69f1c4f061c6fd6f6d9a1267a9211 Mon Sep 17 00:00:00 2001 From: Pabloader Date: Tue, 7 Apr 2026 11:40:02 +0000 Subject: [PATCH] Duplicate first message --- src/games/storywriter/contexts/state.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/games/storywriter/contexts/state.tsx b/src/games/storywriter/contexts/state.tsx index da92cb9..108ef26 100644 --- a/src/games/storywriter/contexts/state.tsx +++ b/src/games/storywriter/contexts/state.tsx @@ -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 {