From 3bf5c14286d28962cc0b106c243054f40a31f2c1 Mon Sep 17 00:00:00 2001
From: vyneer <vyn33r@gmail.com>
Date: Tue, 2 Jul 2024 07:56:37 +0300
Subject: [PATCH] fix: don't create user list on onstream chat

---
 assets/chat/js/chat.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js
index 9988a1a3..9b393ee8 100644
--- a/assets/chat/js/chat.js
+++ b/assets/chat/js/chat.js
@@ -345,14 +345,16 @@ class Chat {
         this,
       ),
     );
-    this.menus.set(
-      'users',
-      new ChatUserMenu(
-        this.ui.find('#chat-user-list'),
-        this.ui.find('#chat-users-btn'),
-        this,
-      ),
-    );
+    if (this.ui.find('#chat-user-list').length > 0) {
+      this.menus.set(
+        'users',
+        new ChatUserMenu(
+          this.ui.find('#chat-user-list'),
+          this.ui.find('#chat-users-btn'),
+          this,
+        ),
+      );
+    }
     this.menus.set(
       'whisper-users',
       new ChatWhisperUsers(