feat(CallScreen, FloatingCallWindow, callStore, wsService): enhance call status handling and UI updates
All checks were successful
Frontend CI / ota-android (push) Successful in 11m58s
Frontend CI / build-and-push-web (push) Successful in 15m49s
Frontend CI / build-android-apk (push) Successful in 1h27m7s

- Updated call status messages to include 'calling', 'reconnecting', and 'failed' states for better user feedback.
- Improved video handling logic in CallScreen to use currentCall.isVideoEnabled for local video display.
- Enhanced callStore to manage new call statuses and ensure proper timeout handling during 'calling' state.
- Added a method in wsService to retrieve the active call state after WebSocket reconnections.
- Refactored FloatingCallWindow to reflect updated call status messages for consistency across components.
This commit is contained in:
lafay
2026-03-28 04:35:05 +08:00
parent fa10ef5116
commit 3c071957ce
5 changed files with 381 additions and 309 deletions

View File

@@ -617,6 +617,10 @@ class WebSocketService {
// Call signaling handlers
private handleCallIncoming(payload: any): void {
console.log('[WSService] call_incoming payload:', JSON.stringify({
call_type: payload.call_type,
media_type: payload.media_type,
}));
const m: WSCallIncomingMessage = {
type: 'call_incoming',
call_id: payload.call_id,
@@ -727,6 +731,21 @@ class WebSocketService {
});
}
/**
* 查询当前活跃的通话
* 用于 WebSocket 重连后恢复通话状态
*/
async getActiveCall(): Promise<any | null> {
try {
const { api } = await import('./api');
const response = await api.get('/calls/active');
return response.data || null;
} catch (error) {
console.log('[WSService] No active call found');
return null;
}
}
sendCallAnswer(callId: string): void {
this.sendFireAndForget('call_answer', { call_id: callId });
}