mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Temporary persona toast respects setting
This commit is contained in:
@@ -748,16 +748,18 @@ function selectCurrentPersona() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// As the last step, inform user if the persona is only temporarily chosen
|
// As the last step, inform user if the persona is only temporarily chosen
|
||||||
const hasDifferentChatLock = !!chat_metadata['persona'] && chat_metadata['persona'] !== user_avatar;
|
if (power_user.persona_show_notifications) {
|
||||||
const hasDifferentDefaultLock = power_user.default_persona && power_user.default_persona !== user_avatar;
|
const hasDifferentChatLock = !!chat_metadata['persona'] && chat_metadata['persona'] !== user_avatar;
|
||||||
|
const hasDifferentDefaultLock = power_user.default_persona && power_user.default_persona !== user_avatar;
|
||||||
|
|
||||||
if (hasDifferentChatLock || (!chat_metadata['persona'] && hasDifferentDefaultLock)) {
|
if (hasDifferentChatLock || (!chat_metadata['persona'] && hasDifferentDefaultLock)) {
|
||||||
const message = t`A different persona is locked to this chat, or you have a different default persona set. The currently selected persona will only be temporary, and resets on reload. Consider locking this persona to the chat if you want to permanently use it.`
|
const message = t`A different persona is locked to this chat, or you have a different default persona set. The currently selected persona will only be temporary, and resets on reload. Consider locking this persona to the chat if you want to permanently use it.`
|
||||||
+ '<br /><br />'
|
+ '<br /><br />'
|
||||||
+ t`Current Persona: ${power_user.personas[user_avatar]}`
|
+ t`Current Persona: ${power_user.personas[user_avatar]}`
|
||||||
+ (hasDifferentChatLock ? '<br />' + t`Chat persona: ${power_user.personas[chat_metadata['persona']]}` : '')
|
+ (hasDifferentChatLock ? '<br />' + t`Chat persona: ${power_user.personas[chat_metadata['persona']]}` : '')
|
||||||
+ (hasDifferentDefaultLock ? '<br />' + t`Default persona: ${power_user.personas[power_user.default_persona]}` : '');
|
+ (hasDifferentDefaultLock ? '<br />' + t`Default persona: ${power_user.personas[power_user.default_persona]}` : '');
|
||||||
toastr.info(message, t`Temporary Persona`, { escapeHtml: false, timeOut: 10000, extendedTimeOut: 20000, preventDuplicates: true });
|
toastr.info(message, t`Temporary Persona`, { escapeHtml: false, timeOut: 10000, extendedTimeOut: 20000, preventDuplicates: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user