mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Sync user name to chat option
This commit is contained in:
@ -6440,9 +6440,27 @@ $(document).ready(function () {
|
||||
name1 = $("#your_name").val();
|
||||
if (name1 === undefined || name1 == "") name1 = default_user_name;
|
||||
console.log(name1);
|
||||
toastr.success(`Your messages will now be sent as ${name1}`, 'User Name updated');
|
||||
saveSettings("change_name");
|
||||
}
|
||||
});
|
||||
|
||||
$('#sync_name_button').on('click', async function () {
|
||||
const confirmation = await callPopup(`<h3>Are you sure?</h3>All user-sent messages in this chat will be attributed to ${name1}.`, 'confirm');
|
||||
|
||||
if (!confirmation) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const mes of chat) {
|
||||
if (mes.is_user) {
|
||||
mes.name = name1;
|
||||
}
|
||||
}
|
||||
|
||||
await saveChatConditional();
|
||||
await reloadCurrentChat();
|
||||
});
|
||||
//Select chat
|
||||
|
||||
$("#api_button_novel").on('click', async function (e) {
|
||||
|
Reference in New Issue
Block a user