Add private calls
All checks were successful
Build and Release / build-and-release (push) Successful in 11m59s
All checks were successful
Build and Release / build-and-release (push) Successful in 11m59s
This commit is contained in:
@@ -64,6 +64,7 @@ export const VoiceProvider = ({ children }) => {
|
||||
parseInt(localStorage.getItem('voiceOutputVolume') || '100')
|
||||
);
|
||||
const isMovingRef = useRef(false);
|
||||
const isDMCallRef = useRef(false);
|
||||
const [isReceivingScreenShareAudio, setIsReceivingScreenShareAudio] = useState(false);
|
||||
|
||||
const convex = useConvex();
|
||||
@@ -226,8 +227,9 @@ export const VoiceProvider = ({ children }) => {
|
||||
}
|
||||
}
|
||||
|
||||
const connectToVoice = async (channelId, channelName, userId) => {
|
||||
const connectToVoice = async (channelId, channelName, userId, isDMCall = false) => {
|
||||
if (activeChannelId === channelId) return;
|
||||
isDMCallRef.current = isDMCall;
|
||||
|
||||
if (room) await room.disconnect();
|
||||
|
||||
@@ -406,6 +408,7 @@ export const VoiceProvider = ({ children }) => {
|
||||
useEffect(() => {
|
||||
if (!activeChannelId || !serverSettings?.afkChannelId || isInAfkChannel) return;
|
||||
if (!idle?.getSystemIdleTime) return;
|
||||
if (isDMCallRef.current) return; // Skip AFK for DM calls
|
||||
|
||||
const afkTimeout = serverSettings.afkTimeout || 300;
|
||||
const interval = setInterval(async () => {
|
||||
@@ -603,6 +606,7 @@ export const VoiceProvider = ({ children }) => {
|
||||
|
||||
const disconnectVoice = () => {
|
||||
console.log('User manually disconnected voice');
|
||||
isDMCallRef.current = false;
|
||||
if (room) room.disconnect();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user