迁移手机抽屉脚本到Vite模块

This commit is contained in:
2026-04-25 08:21:30 +08:00
parent 2f09d5e2ed
commit 308e5690fe
4 changed files with 266 additions and 238 deletions
@@ -71,6 +71,8 @@
});
})();
let onlineUsers = {};
// 暂时暴露给已迁移的手机抽屉 Vite 模块读取,后续在线名单整体迁移后可移除。
window.onlineUsers = onlineUsers;
let autoScroll = true;
let userBadgeRotationTick = 0;
let userListRenderTimer = null;
@@ -2805,6 +2807,8 @@
window.addEventListener('chat:here', (e) => {
const users = e.detail;
onlineUsers = {};
// onlineUsers 使用 let 重建对象时,需要同步 window 引用给 Vite 模块。
window.onlineUsers = onlineUsers;
users.forEach(u => {
hydrateOnlineUserPayload(u.username, u);
});