Skip to content

Commit

Permalink
Used getActiveWindow to work with other windows like whispers
Browse files Browse the repository at this point in the history
  • Loading branch information
Voiture-0 committed Nov 7, 2024
1 parent f6c5fcb commit 44355fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/chat/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});

Expand Down

0 comments on commit 44355fc

Please sign in to comment.