diff --git a/public/script.js b/public/script.js index 059a13351..6193c0c5a 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() { @@ -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);