diff --git a/src/index.js b/src/index.js index e681cb7..2e5d558 100644 --- a/src/index.js +++ b/src/index.js @@ -855,7 +855,8 @@ class WebRTCChat { async startCall() { try { - + // 立即隐藏开始通话按钮 + this.startButton.style.display = 'none'; // 显示等待连接提示 this.showConnectionWaiting(); // 切换到通话中图标 @@ -903,6 +904,7 @@ class WebRTCChat { this.hideConnectionWaiting(); } catch (error) { + this.startButton.style.display = 'block'; // 如果出错,隐藏等待连接提示并恢复到默认图标 this.hideConnectionWaiting(); this.switchToDefaultIcon(); @@ -953,6 +955,8 @@ class WebRTCChat { console.log('通话已结束,5秒后刷新页面清除缓存...'); setTimeout(() => { window.location.reload(); + this.startButton.style.display = 'block'; + this.startButton.disabled = false; }, 2000); }