From c06de1e6bd364d47ba86a467edcf19a4c5acd9c6 Mon Sep 17 00:00:00 2001 From: Aisu Wata Date: Fri, 12 May 2023 00:29:21 -0300 Subject: [PATCH 1/2] hotfix on emtpy content: Was unable to open a certain chat without this --- public/script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/script.js b/public/script.js index 059a13351..cff9b4a37 100644 --- a/public/script.js +++ b/public/script.js @@ -1183,6 +1183,10 @@ function scrollChatToBottom() { function substituteParams(content, _name1, _name2) { _name1 = _name1 ?? name1; _name2 = _name2 ?? name2; + if (!content) { + console.warn("No content on substituteParams") + return '' + } content = content.replace(/{{user}}/gi, _name1); content = content.replace(/{{char}}/gi, _name2); From 8500e049c941220cabe6573818fda0cb8a26f149 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Fri, 12 May 2023 10:14:57 +0300 Subject: [PATCH 2/2] Fix system message overwriting auto-loaded chat #281 --- public/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 059a13351..734cc43c7 100644 --- a/public/script.js +++ b/public/script.js @@ -551,13 +551,13 @@ $.ajaxPrefilter((options, originalOptions, xhr) => { ///// initialization protocol //////// $.get("/csrf-token").then(async (data) => { token = data.token; + sendSystemMessage(system_message_types.WELCOME); await readSecretState(); await getClientVersion(); await getSettings("def"); + await getUserAvatars(); await getCharacters(); await getBackgrounds(); - await getUserAvatars(); - sendSystemMessage(system_message_types.WELCOME); }); function checkOnlineStatus() {