diff --git a/client/js/socket-events/msg.js b/client/js/socket-events/msg.js index e7e8d291..553df62d 100644 --- a/client/js/socket-events/msg.js +++ b/client/js/socket-events/msg.js @@ -75,7 +75,7 @@ socket.on("msg", function(data) { } } - if (channel.messages.length > messageLimit) { + if (messageLimit > 0 && channel.messages.length > messageLimit) { channel.messages.splice(0, channel.messages.length - messageLimit); channel.moreHistoryAvailable = true; }