mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-05-31 23:59:27 +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']");
|
var dms = document.querySelector("[class|='privateChannels']");
|
||||||
|
|
||||||
if (dms){
|
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/']");
|
var nextLink = nextChannel && nextChannel.querySelector("a[href*='/@me/']");
|
||||||
|
|
||||||
if (!nextChannel || !nextLink || !nextChannel.getAttribute("class").includes("channel-")){
|
if (!nextChannel || !nextLink || !nextChannel.getAttribute("class").includes("channel-")){
|
||||||
@ -182,6 +183,7 @@ var DISCORD = (function(){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
nextLink.click();
|
nextLink.click();
|
||||||
|
nextChannel.scrollIntoView(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,6 +205,7 @@ var DISCORD = (function(){
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
nextChannel.children[0].click();
|
nextChannel.children[0].click();
|
||||||
|
nextChannel.scrollIntoView(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user