From 968af1a8b29917af7d680d345357d7939af6d4ba Mon Sep 17 00:00:00 2001 From: RossAscends <124905043+RossAscends@users.noreply.github.com> Date: Thu, 15 Jun 2023 14:14:53 +0900 Subject: [PATCH] fix /newchat --- public/scripts/power-user.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index b68caaea2..b7b7baebf 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -869,8 +869,10 @@ function resetMovablePanels() { eventSource.emit(event_types.MOVABLE_PANELS_RESET); } -function doNewchat() { - $("#option_start_new_chat").trigger('click'); +function doNewChat() { + setTimeout(() => { + $("#option_start_new_chat").trigger('click'); + }, 1); $("#dialogue_popup").hide(); $("#dialogue_popup_ok").trigger('click'); } @@ -1235,6 +1237,6 @@ $(document).ready(() => { }); registerSlashCommand('vn', toggleWaifu, ['vn'], ' – swaps Visual Novel Mode On/Off', false, true); - registerSlashCommand('newchat', doNewchat, ['newchat'], ' – start a new chat with current character', true, true); + registerSlashCommand('newchat', doNewChat, ['newchat'], ' – start a new chat with current character', true, true); registerSlashCommand('delmode', doDelMode, ['delmode'], ' – enter message deletion mode', true, true); });