From 44355fc08f54ade32a9fb491c170e2f2a2c056bd Mon Sep 17 00:00:00 2001 From: Voiture Date: Thu, 7 Nov 2024 12:37:11 -0500 Subject: [PATCH] Used getActiveWindow to work with other windows like whispers --- assets/chat/js/chat.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 16caa65b..895b5602 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -417,9 +417,11 @@ class Chat { document.addEventListener('keydown', (e) => { if (isKeyCode(e, KEYCODES.ESC)) { // If any menus are open, close them first - if ([...this.menus].some(([, menu]) => menu.visible)) ChatMenu.closeMenus(this); + if ([...this.menus].some(([, menu]) => menu.visible)) + ChatMenu.closeMenus(this); // If chat is not pinned, scroll to bottom - else if (!this.mainwindow.scrollplugin.pinned) this.mainwindow.scrollplugin.scrollBottom(); + else if (!this.getActiveWindow().scrollplugin.pinned) + this.getActiveWindow().scrollplugin.scrollBottom(); } });