From aecabde44c293e2ee1f021c1835ccf1277d53345 Mon Sep 17 00:00:00 2001 From: lkddi Date: Sat, 25 Apr 2026 19:29:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=8F=A3=E6=88=BF=E9=97=B4=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E5=88=97=E8=A1=A8=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chat/partials/scripts.blade.php | 44 +------------------ 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/resources/views/chat/partials/scripts.blade.php b/resources/views/chat/partials/scripts.blade.php index 43af87d..e8764b1 100644 --- a/resources/views/chat/partials/scripts.blade.php +++ b/resources/views/chat/partials/scripts.blade.php @@ -1507,48 +1507,8 @@ return; } - if (!data.rooms || !data.rooms.length) { - container.innerHTML = - '
暂无房间
'; - return; - } - const roomRows = data.rooms.map(room => { - const roomId = Number.parseInt(room.id, 10); - if (!Number.isInteger(roomId)) { - return ''; - } - - const isCurrent = roomId === _currentRoomId; - const closed = !room.door_open; - const safeRoomName = escapeHtml(String(room.name ?? '')); - const safeOnlineCount = Math.max(Number.parseInt(room.online, 10) || 0, 0); - const bg = isCurrent ? '#ecf4ff' : '#fff'; - const border = isCurrent ? '#aac5f0' : '#e0eaf5'; - const nameColor = isCurrent ? '#336699' : (closed ? '#bbb' : '#444'); - const badge = safeOnlineCount > 0 ? - `${safeOnlineCount} 人` : - ``; - const currentTag = isCurrent ? - `当前` : - ''; - const clickAttributes = isCurrent ? '' : - `data-room-url="/room/${roomId}" data-room-hover-bg="#ddeeff" data-room-normal-bg="${bg}"`; - - return `
- - ${safeRoomName}${currentTag} - - ${badge} -
`; - }).filter(Boolean).join(''); - - container.innerHTML = roomRows || - '
暂无房间
'; + // 极端慢网下 Vite 可能还未挂载 ChatRoomTools,先显示空态,下一轮刷新会走模块渲染。 + container.innerHTML = '
暂无房间
'; }