'New Chat' in Manage Chats & showLoader when delChat-ing

This commit is contained in:
RossAscends 2023-11-23 17:20:31 +09:00
parent 35349dd8d7
commit e672a7fe99
2 changed files with 17 additions and 3 deletions

View File

@ -3789,6 +3789,7 @@
<span id="ChatHistoryCharName"></span><span data-i18n="Chat History">Chat History</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/chatfilemanagement/#chat-import" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a>
</div>
<div class="fa-solid fa-plus menu_button" title="New Chat" id="newChatFromManageScreenButton"></div>
<input type="text" id="select_chat_search" class="menu_button" placeholder="Search..." autocomplete="off">
<div id="select_chat_cross" class="opacity50p hoverglow fa-solid fa-circle-xmark fontsize120p" alt="Close Past Chat Popup"></div>
</div>

View File

@ -7833,20 +7833,22 @@ jQuery(async function () {
if (popup_type == "del_chat") {
//close past chat popup
$("#select_chat_cross").click();
$("#select_chat_cross").trigger('click');
showLoader()
if (selected_group) {
await deleteGroupChat(selected_group, chat_file_for_del);
} else {
await delChat(chat_file_for_del);
}
//open the history view again after 100ms
//open the history view again after 2seconds (delay to avoid edge cases for deleting last chat)
//hide option popup menu
setTimeout(function () {
$("#option_select_chat").click();
$("#options").hide();
hideLoader()
}, 2000);
}
if (popup_type == "del_ch") {
const deleteChats = !!$("#del_char_checkbox").prop("checked");
@ -8306,6 +8308,17 @@ jQuery(async function () {
hideMenu();
});
$("#newChatFromManageScreenButton").on('click', function () {
setTimeout(() => {
$("#option_start_new_chat").trigger('click');
}, 1);
setTimeout(() => {
$("#dialogue_popup_ok").trigger('click');
}, 1);
$("#select_chat_cross").trigger('click')
})
//////////////////////////////////////////////////////////////////////////////////////////////
//functionality for the cancel delete messages button, reverts to normal display of input form