Sync user name to chat option

This commit is contained in:
SillyLossy
2023-05-28 23:17:49 +03:00
parent b74939bf65
commit 5efd55d343
2 changed files with 20 additions and 0 deletions

View File

@ -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) {