mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-13 07:48:37 +01:00
lib/client: unify checks for chathistory end
This commit is contained in:
parent
2d27168529
commit
dc5e64aaac
@ -916,7 +916,7 @@ export default class Client extends EventTarget {
|
|||||||
if (limit <= 0) {
|
if (limit <= 0) {
|
||||||
throw new Error("Cannot fetch all chat history: too many messages");
|
throw new Error("Cannot fetch all chat history: too many messages");
|
||||||
}
|
}
|
||||||
if (messages.length == max) {
|
if (messages.length >= max) {
|
||||||
// There are still more messages to fetch
|
// There are still more messages to fetch
|
||||||
after.time = messages[messages.length - 1].tags.time;
|
after.time = messages[messages.length - 1].tags.time;
|
||||||
return this.fetchHistoryBetween(target, after, before, limit);
|
return this.fetchHistoryBetween(target, after, before, limit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user