mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Make sure channel exists.
This commit is contained in:
parent
8cb49ae56a
commit
d9f8f45169
1 changed files with 6 additions and 4 deletions
|
@ -97,11 +97,13 @@ Mousetrap.bind(["alt+a"], function() {
|
|||
function jumpToChannel(targetChannel) {
|
||||
switchToChannel(targetChannel);
|
||||
|
||||
scrollIntoViewNicely(
|
||||
document.querySelector(
|
||||
const element = document.querySelector(
|
||||
`#sidebar .channel-list-item[aria-controls="#chan-${targetChannel.id}"]`
|
||||
)
|
||||
);
|
||||
|
||||
if (element) {
|
||||
scrollIntoViewNicely(element);
|
||||
}
|
||||
}
|
||||
|
||||
// Ignored keys which should not automatically focus the input bar
|
||||
|
|
Loading…
Reference in a new issue