mirror of
https://github.com/thelounge/thelounge.git
synced 2026-03-14 14:35:50 +01:00
fix: call stack size exceeded
The spread operator will place the arguments, which can reach the call stack limit if too many messages are being sent. This fix uses `.concat()` to avoid the spread operator. Fixes #5022
This commit is contained in:
parent
b2e3112806
commit
03d01bb1d6
2 changed files with 2 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ socket.on("more", async (data) => {
|
|||
);
|
||||
channel.moreHistoryAvailable =
|
||||
data.totalMessages > channel.messages.length + data.messages.length;
|
||||
channel.messages.unshift(...data.messages);
|
||||
channel.messages = data.messages.concat(channel.messages);
|
||||
|
||||
await nextTick();
|
||||
channel.historyLoading = false;
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ class Chan {
|
|||
return;
|
||||
}
|
||||
|
||||
this.messages.unshift(...messages);
|
||||
this.messages = messages.concat(this.messages);
|
||||
|
||||
if (!this.firstUnread) {
|
||||
this.firstUnread = messages[messages.length - 1].id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue