refactor: unify DM calls with server voice architecture
Merge connectDm() into connect() with isDm flag, eliminating ~145 lines of duplicated LiveKit room setup. DM calls now inherit all event handlers (SpeakingDetector cleanup, deafen broadcasts, metadata changes). Replace monolithic DmCallView with shared VoiceGrid + VoiceControlBar components, making DM calls group-DM-ready with full feature parity.
This commit is contained in:
@@ -95,7 +95,6 @@ export function AppLayout() {
|
||||
const activeDmCall = useVoiceStore((s) => s.activeDmCall);
|
||||
const {
|
||||
connect: connectVoice,
|
||||
connectDm: connectDmVoice,
|
||||
disconnect: disconnectVoice,
|
||||
isConnected: isVoiceConnected,
|
||||
isConnecting: isVoiceConnecting,
|
||||
@@ -133,7 +132,7 @@ export function AppLayout() {
|
||||
lastAttemptedRef.current = targetChannelId;
|
||||
|
||||
if (activeDmCall) {
|
||||
await connectDmVoice(activeDmCall.dmChannelId);
|
||||
await connectVoice(activeDmCall.dmChannelId, true);
|
||||
} else {
|
||||
await connectVoice(targetChannelId);
|
||||
}
|
||||
@@ -162,8 +161,7 @@ export function AppLayout() {
|
||||
isWsConnected,
|
||||
isLoading,
|
||||
user,
|
||||
connectVoice,
|
||||
connectDmVoice,
|
||||
connectVoice,
|
||||
disconnectVoice
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user