diff --git a/public/script.js b/public/script.js index f89392a54..c88284a62 100644 --- a/public/script.js +++ b/public/script.js @@ -811,6 +811,7 @@ async function printCharacters() { favsToHotswap(); await delay(300); updateVisibleDivs('#rm_print_characters_block', true); + displayOverrideWarnings(); } @@ -5765,7 +5766,9 @@ function updateVisibleDivs(containerSelector, resizecontainer) { } function displayOverrideWarnings() { - if (!this_chid) { + if (!this_chid || !selected_group) { + $('.prompt_overridden').hide(); + $('.jailbreak_overridden').hide(); return; } diff --git a/public/scripts/extensions/floating-prompt/index.js b/public/scripts/extensions/floating-prompt/index.js index f24a34909..fc2d70bba 100644 --- a/public/scripts/extensions/floating-prompt/index.js +++ b/public/scripts/extensions/floating-prompt/index.js @@ -177,11 +177,14 @@ function loadSettings() { $('#extension_floating_depth').val(chat_metadata[metadata_keys.depth]); $(`input[name="extension_floating_position"][value="${chat_metadata[metadata_keys.position]}"]`).prop('checked', true); - if (extension_settings.note.chara) { + if (extension_settings.note.chara && getContext().characterId) { const charaNote = extension_settings.note.chara.find((e) => e.name === getCharaFilename()); $('#extension_floating_chara').val(charaNote ? charaNote.prompt : ''); $('#extension_use_floating_chara').prop('checked', charaNote ? charaNote.useChara : false); + } else { + $('#extension_floating_chara').val(''); + $('#extension_use_floating_chara').prop('checked', false); } $('#extension_floating_default').val(extension_settings.note.default); @@ -216,7 +219,7 @@ async function moduleWorker() { const shouldAddPrompt = messagesTillInsertion == 0; let prompt = shouldAddPrompt ? $('#extension_floating_prompt').val() : ''; - if (shouldAddPrompt && extension_settings.note.chara) { + if (shouldAddPrompt && extension_settings.note.chara && getContext().characterId) { const charaNote = extension_settings.note.chara.find((e) => e.name === getCharaFilename()); // Only replace with the chara note if the user checked the box @@ -263,11 +266,16 @@ function onANMenuItemClick() { } function onChatChanged() { + const context = getContext(); + + // Disable the chara note if in a group + $('#extension_floating_chara').prop('disabled', context.groupId ? true : false); + const tokenCounter1 = chat_metadata[metadata_keys.prompt] ? getTokenCount(chat_metadata[metadata_keys.prompt]) : 0; $('#extension_floating_prompt_token_counter').text(tokenCounter1); let tokenCounter2; - if (extension_settings.note.chara) { + if (extension_settings.note.chara && context.characterId) { const charaNote = extension_settings.note.chara.find((e) => e.name === getCharaFilename()); if (charaNote) { @@ -338,13 +346,13 @@ setTimeout(function () {
- Will be automatically added as the author's note for this character. + Will be automatically added as the author's note for this character. Will be used in groups, but can't be modified when a group chat is open.
Tokens: 0
-