fix: Bug - In direct voice call the status is displayed as offline
Resolve direct-call participant join state and DM peer status across user identity aliases so call UI no longer shows participants as disconnected when they are in the call. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/member-ordering */
|
||||
|
||||
import {
|
||||
CUSTOM_ELEMENTS_SCHEMA,
|
||||
Component,
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
participantToUser,
|
||||
type DirectCallSession
|
||||
} from '../../domains/direct-call';
|
||||
import { isDirectCallParticipantJoined } from '../../domains/direct-call/domain/logic/direct-call-participant-identity.rules';
|
||||
import { DmChatComponent } from '../../domains/direct-message/feature/dm-chat/dm-chat.component';
|
||||
import {
|
||||
VoiceActivityService,
|
||||
@@ -123,9 +124,9 @@ export class PrivateCallComponent {
|
||||
});
|
||||
readonly isConnected = computed(() => {
|
||||
const session = this.session();
|
||||
const currentUserId = this.currentUserKey();
|
||||
const currentUser = this.currentUser();
|
||||
|
||||
return !!session && !!currentUserId && !!session.participants[currentUserId]?.joined;
|
||||
return !!session && !!currentUser && isDirectCallParticipantJoined(session, currentUser);
|
||||
});
|
||||
readonly isMuted = this.voice.isMuted;
|
||||
readonly isDeafened = this.voice.isDeafened;
|
||||
@@ -439,7 +440,6 @@ export class PrivateCallComponent {
|
||||
|
||||
isParticipantConnected(user: User): boolean {
|
||||
const session = this.session();
|
||||
const userId = this.userKey(user);
|
||||
const current = this.currentUser();
|
||||
|
||||
if (!session) {
|
||||
@@ -453,11 +453,11 @@ export class PrivateCallComponent {
|
||||
);
|
||||
const isSelf = !!current && (user.id === current.id || user.oderId === current.oderId);
|
||||
|
||||
if (isSelf && inCallVoice) {
|
||||
if (isSelf && (isDirectCallParticipantJoined(session, user) || inCallVoice)) {
|
||||
return isLocalVoiceOwner(user.voiceState, this.realtime.getClientInstanceId());
|
||||
}
|
||||
|
||||
return !!session.participants[userId]?.joined || inCallVoice;
|
||||
return isDirectCallParticipantJoined(session, user) || inCallVoice;
|
||||
}
|
||||
|
||||
isPassiveCallParticipant(user: User): boolean {
|
||||
|
||||
Reference in New Issue
Block a user