Fix history not loading after trimming
This commit is contained in:
parent
6a82114b62
commit
b88a186d05
@ -131,7 +131,11 @@ window.vueMounted = () => {
|
||||
|
||||
if (lastChannel.messages.length > 0) {
|
||||
lastChannel.firstUnread = lastChannel.messages[lastChannel.messages.length - 1].id;
|
||||
}
|
||||
|
||||
if (lastChannel.messages.length > 100) {
|
||||
lastChannel.messages.splice(0, lastChannel.messages.length - 100);
|
||||
lastChannel.moreHistoryAvailable = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,8 +75,9 @@ socket.on("msg", function(data) {
|
||||
}
|
||||
}
|
||||
|
||||
if (messageLimit > 0) {
|
||||
if (channel.messages.length > messageLimit) {
|
||||
channel.messages.splice(0, channel.messages.length - messageLimit);
|
||||
channel.moreHistoryAvailable = true;
|
||||
}
|
||||
|
||||
if ((data.msg.type === "message" || data.msg.type === "action") && channel.type === "channel") {
|
||||
|
Loading…
Reference in New Issue
Block a user