Add just a chat fields list from server

This commit is contained in:
Cohee 2024-06-06 02:05:26 +03:00
parent 76c35d269b
commit 671b7ef7cb
2 changed files with 6 additions and 0 deletions

View File

@ -7684,6 +7684,8 @@ window['SillyTavern'].getContext = function () {
setExtensionPrompt: setExtensionPrompt,
updateChatMetadata: updateChatMetadata,
saveChat: saveChatConditional,
openCharacterChat: openCharacterChat,
openGroupChat: openGroupChat,
saveMetadata: saveMetadata,
sendSystemMessage: sendSystemMessage,
activateSendButtons,

View File

@ -956,6 +956,10 @@ router.post('/chats', jsonParser, async function (request, response) {
return;
}
if (request.body.simple) {
return response.send(jsonFiles.map(file => ({ file_name: file })));
}
const jsonFilesPromise = jsonFiles.map((file) => {
return new Promise(async (res) => {
const pathToFile = path.join(request.user.directories.chats, characterDirectory, file);