#829 Close chat option

This commit is contained in:
Cohee 2023-07-30 21:35:21 +03:00
parent 638050a3de
commit 49f7185c8c
3 changed files with 25 additions and 1 deletions

View File

@ -3782,6 +3782,10 @@
<!-- popups live outside sheld to avoid blur conflicts -->
<div id="options" class="font-family-reset" style="display: none;">
<div class="options-content">
<a id="option_close_chat">
<i class="fa-lg fa-solid fa-times"></i>
<span data-i18n="Close chat">Close chat</span>
</a>
<a id="option_settings">
<i class="fa-lg fa-solid fa-cog"></i>
<span data-i18n="Toggle Panels">Toggle Panels</span>

View File

@ -7752,6 +7752,26 @@ $(document).ready(function () {
setTimeout(openMessageDelete, animation_duration);
}
else if (id == "option_close_chat") {
if (is_send_press == false) {
clearChat();
chat.length = 0;
resetSelectedGroup();
setCharacterId(undefined);
setCharacterName('');
setActiveCharacter(null);
setActiveGroup(null);
this_edit_mes_id = undefined;
chat_metadata = {};
selected_button = "characters";
$("#rm_button_selected_ch").children("h2").text('');
select_rm_characters();
sendSystemMessage(system_message_types.WELCOME);
} else {
toastr.info("Please stop the message generation first.");
}
}
else if (id === "option_settings") {
//var checkBox = document.getElementById("waifuMode");
var topBar = document.getElementById("top-bar");

View File

@ -609,7 +609,7 @@ hr {
display: flex;
column-gap: 10px;
cursor: pointer;
align-items: baseline;
}
#extensionsMenu>div,