mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-14 07:37:13 +03:00
Fix ignoring settings for reaching the first message in a channel if no new messages were saved
This commit is contained in:
parent
ae821f738e
commit
f70bbd53d9
14
app/Resources/Tracker/bootstrap.js
vendored
14
app/Resources/Tracker/bootstrap.js
vendored
@ -42,6 +42,10 @@
|
|||||||
stopTrackingDelayed(() => isSending = false);
|
stopTrackingDelayed(() => isSending = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isNoAction = function(action) {
|
||||||
|
return action === null || action === CONSTANTS.AUTOSCROLL_ACTION_NOTHING;
|
||||||
|
};
|
||||||
|
|
||||||
const onTrackingContinued = function(anyNewMessages) {
|
const onTrackingContinued = function(anyNewMessages) {
|
||||||
if (!STATE.isTracking()) {
|
if (!STATE.isTracking()) {
|
||||||
return;
|
return;
|
||||||
@ -59,14 +63,14 @@
|
|||||||
if (SETTINGS.autoscroll) {
|
if (SETTINGS.autoscroll) {
|
||||||
let action = null;
|
let action = null;
|
||||||
|
|
||||||
if (!anyNewMessages) {
|
if (!DISCORD.hasMoreMessages()) {
|
||||||
action = SETTINGS.afterSavedMsg;
|
|
||||||
}
|
|
||||||
else if (!DISCORD.hasMoreMessages()) {
|
|
||||||
action = SETTINGS.afterFirstMsg;
|
action = SETTINGS.afterFirstMsg;
|
||||||
}
|
}
|
||||||
|
if (isNoAction(action) && !anyNewMessages) {
|
||||||
|
action = SETTINGS.afterSavedMsg;
|
||||||
|
}
|
||||||
|
|
||||||
if (action === null || action === CONSTANTS.AUTOSCROLL_ACTION_NOTHING) {
|
if (isNoAction(action)) {
|
||||||
DISCORD.loadOlderMessages();
|
DISCORD.loadOlderMessages();
|
||||||
}
|
}
|
||||||
else if (action === CONSTANTS.AUTOSCROLL_ACTION_PAUSE || (action === CONSTANTS.AUTOSCROLL_ACTION_SWITCH && !DISCORD.selectNextTextChannel())) {
|
else if (action === CONSTANTS.AUTOSCROLL_ACTION_PAUSE || (action === CONSTANTS.AUTOSCROLL_ACTION_SWITCH && !DISCORD.selectNextTextChannel())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user