From c33bd85969616eed98043eb07a4c3e879b04d0c2 Mon Sep 17 00:00:00 2001 From: vyneer Date: Sun, 14 Jan 2024 23:00:24 +0300 Subject: [PATCH 1/2] fix: generate command autocomplete for mods correctly --- assets/chat/js/chat.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 2411c67c..3991c6a9 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -346,9 +346,6 @@ class Chat { ), ); - this.commands - .generateAutocomplete(this.user.hasModPowers()) - .forEach((command) => this.autocomplete.add(command)); this.autocomplete.bind(this); // Chat input @@ -683,6 +680,11 @@ class Chat { $(document.body).toggleClass(`pref-fontscale`, fontscale !== 'auto'); $(document.body).attr('data-fontscale', fontscale); + // Add command autocomplete + this.commands + .generateAutocomplete(this.user.hasModPowers()) + .forEach((command) => this.autocomplete.add(command)); + for (const window of this.windows.values()) { window.updateMessages(this); } From f3d6b12960dfbbed285aeb50f4e29589562b6577 Mon Sep 17 00:00:00 2001 From: vyneer Date: Thu, 29 Feb 2024 19:08:13 +0300 Subject: [PATCH 2/2] fix: move autocomplete gen to a better spot --- assets/chat/js/chat.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 3991c6a9..3dda3d37 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -222,6 +222,9 @@ class Chat { this.user = this.addUser(user); this.authenticated = true; } + this.commands + .generateAutocomplete(this.user.hasModPowers()) + .forEach((command) => this.autocomplete.add(command)); this.setDefaultPlaceholderText(); return this; } @@ -680,11 +683,6 @@ class Chat { $(document.body).toggleClass(`pref-fontscale`, fontscale !== 'auto'); $(document.body).attr('data-fontscale', fontscale); - // Add command autocomplete - this.commands - .generateAutocomplete(this.user.hasModPowers()) - .forEach((command) => this.autocomplete.add(command)); - for (const window of this.windows.values()) { window.updateMessages(this); }