mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 17:10:45 +01:00
Fix persona switch input trigger
This commit is contained in:
parent
f04c277f03
commit
3eeb137416
@ -1,4 +1,21 @@
|
|||||||
import { callPopup, characters, chat_metadata, default_avatar, eventSource, event_types, getRequestHeaders, getThumbnailUrl, getUserAvatars, name1, saveMetadata, saveSettingsDebounced, setUserName, this_chid, user_avatar } from "../script.js";
|
import {
|
||||||
|
callPopup,
|
||||||
|
characters,
|
||||||
|
chat_metadata,
|
||||||
|
default_avatar,
|
||||||
|
eventSource,
|
||||||
|
event_types,
|
||||||
|
getRequestHeaders,
|
||||||
|
getThumbnailUrl,
|
||||||
|
getUserAvatars,
|
||||||
|
name1,
|
||||||
|
saveMetadata,
|
||||||
|
saveSettingsDebounced,
|
||||||
|
setUserName,
|
||||||
|
this_chid,
|
||||||
|
user_avatar,
|
||||||
|
} from "../script.js";
|
||||||
|
import { getContext } from "./extensions.js";
|
||||||
import { persona_description_positions, power_user } from "./power-user.js";
|
import { persona_description_positions, power_user } from "./power-user.js";
|
||||||
import { getTokenCount } from "./tokenizers.js";
|
import { getTokenCount } from "./tokenizers.js";
|
||||||
import { debounce, delay, download, parseJsonFile } from "./utils.js";
|
import { debounce, delay, download, parseJsonFile } from "./utils.js";
|
||||||
@ -254,9 +271,14 @@ export function selectCurrentPersona() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setPersonaDescription();
|
setPersonaDescription();
|
||||||
|
|
||||||
|
// force firstMes {{user}} update on persona switch
|
||||||
|
const context = getContext();
|
||||||
|
if (context.characterId >= 0 && !context.groupId && context.chat.length === 1) {
|
||||||
$("#firstmessage_textarea").trigger('input')
|
$("#firstmessage_textarea").trigger('input')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function lockUserNameToChat() {
|
async function lockUserNameToChat() {
|
||||||
if (chat_metadata['persona']) {
|
if (chat_metadata['persona']) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user