File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
packages/gpt-runner-web/client/src Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ export const ChatPanel: FC<ChatPanelProps> = (props) => {
50
50
return
51
51
52
52
const index = chatIds . indexOf ( chatId )
53
- let nextIndex = index - 1
53
+ let nextIndex = index + 1
54
54
55
- if ( nextIndex < 0 )
56
- nextIndex = chatIds . length - 1
55
+ if ( nextIndex >= chatIds . length )
56
+ nextIndex = 0
57
57
58
58
const nextChatId = chatIds [ nextIndex ]
59
59
onChatIdChange ( nextChatId )
@@ -67,10 +67,10 @@ export const ChatPanel: FC<ChatPanelProps> = (props) => {
67
67
return
68
68
69
69
const index = chatIds . indexOf ( chatId )
70
- let nextIndex = index + 1
70
+ let nextIndex = index - 1
71
71
72
- if ( nextIndex >= chatIds . length )
73
- nextIndex = 0
72
+ if ( nextIndex < 0 )
73
+ nextIndex = chatIds . length - 1
74
74
75
75
const nextChatId = chatIds [ nextIndex ]
76
76
onChatIdChange ( nextChatId )
Original file line number Diff line number Diff line change @@ -167,12 +167,13 @@ export const createSidebarTreeSlice: StateCreator<
167
167
} ,
168
168
createChatAndActive ( gptFileId ) {
169
169
const state = get ( )
170
+ const gptFileTreeItem = state . getSidebarTreeItem ( gptFileId ) as GptFileTreeItem
170
171
const { chatInstance } = state . addChatInstance ( gptFileId , {
171
172
name : DEFAULT_CHAT_NAME ,
172
- inputtingPrompt : '' ,
173
- systemPrompt : '' ,
173
+ inputtingPrompt : gptFileTreeItem ?. otherInfo ?. singleFileConfig . userPrompt || '' ,
174
+ systemPrompt : gptFileTreeItem ?. otherInfo ?. singleFileConfig . systemPrompt || '' ,
174
175
messages : [ ] ,
175
- singleFileConfig : { } ,
176
+ singleFileConfig : gptFileTreeItem ?. otherInfo ?. singleFileConfig || { } ,
176
177
status : ChatMessageStatus . Success ,
177
178
} )
178
179
You can’t perform that action at this time.
0 commit comments