mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-20 16:54:16 +03:00
Fix "switch to next channel" skipping channels that take too long to load
This commit is contained in:
parent
5c8660afd1
commit
ecc6ff29ce
@ -41,12 +41,18 @@ DISCORD.setupMessageUpdateCallback(hasMoreMessages => {
|
||||
STATE.addDiscordChannel(info.server, info.type, info.id, info.channel);
|
||||
|
||||
let messages = DISCORD.getMessages();
|
||||
|
||||
if (!messages.length){
|
||||
DISCORD.loadOlderMessages();
|
||||
return;
|
||||
}
|
||||
|
||||
let hasUpdatedFile = STATE.addDiscordMessages(info.id, messages);
|
||||
|
||||
if (SETTINGS.autoscroll){
|
||||
let action = CONSTANTS.AUTOSCROLL_ACTION_NOTHING;
|
||||
|
||||
if (!hasUpdatedFile && !(messages.length && STATE.isMessageFresh(messages[0].id))){
|
||||
if (!hasUpdatedFile && !STATE.isMessageFresh(messages[0].id)){
|
||||
action = SETTINGS.afterSavedMsg;
|
||||
}
|
||||
else if (!hasMoreMessages){
|
||||
|
Loading…
x
Reference in New Issue
Block a user