Chats: Fix past chat fetching

Includes checks if an element of the array includes a character ID,
but the array contains characters. We want to check if the value
at the specified index exists in the first place.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2023-11-08 00:46:26 -05:00
parent 00c029a65a
commit 8155b1c365

View File

@ -5520,7 +5520,7 @@ export async function getChatsFromFiles(data, isGroupChat) {
* in descending order by file name. Returns `undefined` if the fetch request is unsuccessful.
*/
async function getPastCharacterChats() {
if (!characters.includes(this_chid)) return;
if (!characters[this_chid]) return;
const response = await fetch("/getallchatsofcharacter", {
method: 'POST',