mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-13 15:27:16 +03:00
Add isInMessageView to discord.js and use it to prevent instant autoscrolling
This commit is contained in:
parent
d6bbb57a3f
commit
50a1e2e94e
@ -69,6 +69,13 @@ var DISCORD = (function(){
|
||||
return obj.channel.length === 0 ? null : obj;
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns true if the message column is visible.
|
||||
*/
|
||||
isInMessageView: function(){
|
||||
return DOM.cls("messages").length > 0;
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns true if there are more messages available.
|
||||
*/
|
||||
|
@ -30,7 +30,7 @@ DISCORD.setupMessageRequestHook((channel, messages) => {
|
||||
});
|
||||
|
||||
STATE.onStateChanged((type, detail) => {
|
||||
if (type === "tracking" && detail && STATE.settings.autoscroll){
|
||||
if (type === "tracking" && detail && STATE.settings.autoscroll && DISCORD.isInMessageView()){
|
||||
if (DISCORD.hasMoreMessages()){
|
||||
DISCORD.loadOlderMessages();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user