fix delete 1 chat
This commit is contained in:
@@ -181,13 +181,16 @@ export function App() {
|
|||||||
if (!confirm("Are you sure you want to delete this chat history?"))
|
if (!confirm("Are you sure you want to delete this chat history?"))
|
||||||
return;
|
return;
|
||||||
const oldAPIkey = allChatStore[selectedChatIndex].apiKey;
|
const oldAPIkey = allChatStore[selectedChatIndex].apiKey;
|
||||||
|
const oldSystemMessageContent =
|
||||||
|
allChatStore[selectedChatIndex].systemMessageContent;
|
||||||
|
const oldAPIEndpoint = allChatStore[selectedChatIndex].apiEndpoint;
|
||||||
allChatStore.splice(selectedChatIndex, 1);
|
allChatStore.splice(selectedChatIndex, 1);
|
||||||
if (allChatStore.length === 0) {
|
if (allChatStore.length === 0) {
|
||||||
allChatStore.push(
|
allChatStore.push(
|
||||||
newChatStore(
|
newChatStore(
|
||||||
oldAPIkey,
|
defaultAPIKEY() || oldAPIkey,
|
||||||
allChatStore[selectedChatIndex].systemMessageContent,
|
defaultSysMessage() || oldSystemMessageContent,
|
||||||
allChatStore[selectedChatIndex].apiEndpoint
|
defaultAPIEndpoint() || oldAPIEndpoint
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
setSelectedChatIndex(0);
|
setSelectedChatIndex(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user