mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-13 15:27:16 +03:00
Force scroll channel to top after selecting it to (hopefully) improve reliability
This commit is contained in:
parent
b442e87050
commit
ffffeb792b
@ -174,7 +174,8 @@ var DISCORD = (function(){
|
||||
var dms = document.querySelector("[class|='privateChannels']");
|
||||
|
||||
if (dms){
|
||||
var nextChannel = DOM.queryReactClass("selected", dms).nextElementSibling;
|
||||
var currentChannel = DOM.queryReactClass("selected", dms);
|
||||
var nextChannel = currentChannel && currentChannel.nextElementSibling;
|
||||
var nextLink = nextChannel && nextChannel.querySelector("a[href*='/@me/']");
|
||||
|
||||
if (!nextChannel || !nextLink || !nextChannel.getAttribute("class").includes("channel-")){
|
||||
@ -182,6 +183,7 @@ var DISCORD = (function(){
|
||||
}
|
||||
else{
|
||||
nextLink.click();
|
||||
nextChannel.scrollIntoView(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -203,6 +205,7 @@ var DISCORD = (function(){
|
||||
}
|
||||
else{
|
||||
nextChannel.children[0].click();
|
||||
nextChannel.scrollIntoView(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user