Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ function connectWebSocket() {
console.error('WebSocket error:', error);
if (error.target.readyState === WebSocket.CLOSED) {
alert('密码错误或连接失败');
// 显示密码输入框,隐藏主界面
document.querySelector('.left').style.display = 'none';
document.querySelector('.right').style.display = 'none';
document.getElementById('passwordModal').style.display = 'block';
document.getElementById('roomPasswordInput').value = '';
document.getElementById('roomPasswordInput').focus();
if (roomId) {
// 显示密码输入框,隐藏主界面
document.querySelector('.left').style.display = 'none';
document.querySelector('.right').style.display = 'none';
document.getElementById('passwordModal').style.display = 'block';
document.getElementById('roomPasswordInput').value = '';
document.getElementById('roomPasswordInput').focus();
}
}
};
}
Expand Down Expand Up @@ -670,4 +672,4 @@ document.addEventListener('DOMContentLoaded', function() {
if (window.innerWidth <= 768) {
document.body.classList.remove('show-users');
}
});
});