Fix immediate switching between persona namesakes

This commit is contained in:
Cohee 2023-10-23 23:20:49 +03:00
parent 3f9cb7d575
commit 5b68a438f3
1 changed files with 5 additions and 2 deletions

View File

@ -181,7 +181,7 @@ async function bindUserNameToPersona() {
export function selectCurrentPersona() {
const personaName = power_user.personas[user_avatar];
if (personaName && name1 !== personaName) {
if (personaName) {
const lockedPersona = chat_metadata['persona'];
if (lockedPersona && lockedPersona !== user_avatar && power_user.persona_show_notifications) {
toastr.info(
@ -191,7 +191,10 @@ export function selectCurrentPersona() {
);
}
setUserName(personaName);
if (personaName !== name1) {
console.log(`Auto-updating user name to ${personaName}`);
setUserName(personaName);
}
const descriptor = power_user.persona_descriptions[user_avatar];