fix: Fix multiple bugs with new authentication flow
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
[class.shadow-[0_0_0_6px_rgba(16,185,129,0.12)]]="speaking() && compact()"
|
||||
[class.shadow-[0_0_0_8px_rgba(16,185,129,0.12)]]="speaking() && !compact()"
|
||||
[class.ring-border]="!speaking()"
|
||||
[class.opacity-55]="!connected()"
|
||||
[class.opacity-55]="!connected() || passive()"
|
||||
>
|
||||
@if (user().avatarUrl) {
|
||||
<img
|
||||
|
||||
@@ -18,6 +18,7 @@ export class PrivateCallParticipantCardComponent {
|
||||
readonly speaking = input.required<boolean>();
|
||||
readonly issueLabel = input<string | null>(null);
|
||||
readonly compact = input(false);
|
||||
readonly passive = input(false);
|
||||
|
||||
avatarSize(): string {
|
||||
return this.compact() ? '5.75rem' : 'clamp(6.5rem, 38vw, 13rem)';
|
||||
|
||||
@@ -148,6 +148,7 @@
|
||||
[connected]="isParticipantConnected(user)"
|
||||
[speaking]="isSpeaking(user)"
|
||||
[issueLabel]="participantIssueLabel(user)"
|
||||
[passive]="isPassiveCallParticipant(user)"
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
@@ -164,6 +165,7 @@
|
||||
[connected]="isParticipantConnected(user)"
|
||||
[speaking]="isSpeaking(user)"
|
||||
[issueLabel]="participantIssueLabel(user)"
|
||||
[passive]="isPassiveCallParticipant(user)"
|
||||
[compact]="true"
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -44,6 +44,11 @@ import {
|
||||
import { loadVoiceSettingsFromStorage, saveVoiceSettingsToStorage } from '../../domains/voice-session';
|
||||
import { ScreenShareQualityDialogComponent } from '../../shared';
|
||||
import { ViewportService } from '../../core/platform';
|
||||
import { RealtimeSessionFacade } from '../../core/realtime';
|
||||
import {
|
||||
isLocalVoiceOwner,
|
||||
isVoiceOnAnotherClient
|
||||
} from '../../domains/voice-session';
|
||||
import { MobileMediaService, MobilePlatformService } from '../../infrastructure/mobile';
|
||||
import { selectAllUsers, selectCurrentUser } from '../../store/users/users.selectors';
|
||||
import { UsersActions } from '../../store/users/users.actions';
|
||||
@@ -85,6 +90,7 @@ export class PrivateCallComponent {
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
private readonly store = inject(Store);
|
||||
private readonly calls = inject(DirectCallService);
|
||||
private readonly realtime = inject(RealtimeSessionFacade);
|
||||
private readonly voice = inject(VoiceConnectionFacade);
|
||||
private readonly voiceActivity = inject(VoiceActivityService);
|
||||
private readonly playback = inject(VoicePlaybackService);
|
||||
@@ -437,18 +443,38 @@ export class PrivateCallComponent {
|
||||
isParticipantConnected(user: User): boolean {
|
||||
const session = this.session();
|
||||
const userId = this.userKey(user);
|
||||
const current = this.currentUser();
|
||||
|
||||
if (!session) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
!!session.participants[userId]?.joined ||
|
||||
!!(user.voiceState?.isConnected && user.voiceState.roomId === session.callId && user.voiceState.serverId === session.callId)
|
||||
const inCallVoice = !!(
|
||||
user.voiceState?.isConnected
|
||||
&& user.voiceState.roomId === session.callId
|
||||
&& user.voiceState.serverId === session.callId
|
||||
);
|
||||
const isSelf = !!current && (user.id === current.id || user.oderId === current.oderId);
|
||||
|
||||
if (isSelf && inCallVoice) {
|
||||
return isLocalVoiceOwner(user.voiceState, this.realtime.getClientInstanceId());
|
||||
}
|
||||
|
||||
return !!session.participants[userId]?.joined || inCallVoice;
|
||||
}
|
||||
|
||||
isPassiveCallParticipant(user: User): boolean {
|
||||
const current = this.currentUser();
|
||||
const isSelf = !!current && (user.id === current.id || user.oderId === current.oderId);
|
||||
|
||||
return isSelf && isVoiceOnAnotherClient(user.voiceState, this.realtime.getClientInstanceId());
|
||||
}
|
||||
|
||||
participantIssueLabel(user: User): string | null {
|
||||
if (this.isPassiveCallParticipant(user)) {
|
||||
return this.i18n.instant('call.private.voiceOnOtherDevice');
|
||||
}
|
||||
|
||||
return this.isParticipantConnected(user) ? null : this.i18n.instant('call.private.waiting');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user