From 74edfcaa042e6dd40254d482bbfbb93bb0975ba9 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 12 Sep 2018 23:35:55 +0300 Subject: [PATCH] Limit input history to a 100 entries. --- client/components/ChatInput.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/components/ChatInput.vue b/client/components/ChatInput.vue index e079a70a..6c3af610 100644 --- a/client/components/ChatInput.vue +++ b/client/components/ChatInput.vue @@ -202,6 +202,11 @@ export default { this.channel.inputHistory.splice(1, 0, text); } + // Limit input history to a 100 entries + if (this.channel.inputHistory.length > 100) { + this.channel.inputHistory.pop(); + } + if (text[0] === "/") { const args = text.substr(1).split(" "); const cmd = args.shift().toLowerCase();