From b840687b6e1011cdb60ef655892e25d8dd7d5d79 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Tue, 13 Aug 2024 18:16:19 +0530 Subject: [PATCH 1/2] fix: skip permissions if headless --- packages/hms-video-store/src/transport/index.ts | 4 ---- packages/react-sdk/src/hooks/useAwayNotifications.ts | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/hms-video-store/src/transport/index.ts b/packages/hms-video-store/src/transport/index.ts index b5c494f562..f3c0c9e6ca 100644 --- a/packages/hms-video-store/src/transport/index.ts +++ b/packages/hms-video-store/src/transport/index.ts @@ -786,10 +786,6 @@ export default class HMSTransport { const log = newState === 'disconnected' ? HMSLogger.w.bind(HMSLogger) : HMSLogger.d.bind(HMSLogger); log(TAG, `Subscribe ice connection state change: ${newState}`); - // if (newState === 'failed') { - // // await this.handleIceConnectionFailure(HMSConnectionRole.Subscribe); - // } - if (newState === 'connected') { const callback = this.callbacks.get(SUBSCRIBE_ICE_CONNECTION_CALLBACK_ID); this.callbacks.delete(SUBSCRIBE_ICE_CONNECTION_CALLBACK_ID); diff --git a/packages/react-sdk/src/hooks/useAwayNotifications.ts b/packages/react-sdk/src/hooks/useAwayNotifications.ts index 6161c34790..574fa08e93 100644 --- a/packages/react-sdk/src/hooks/useAwayNotifications.ts +++ b/packages/react-sdk/src/hooks/useAwayNotifications.ts @@ -7,6 +7,9 @@ import { useHMSVanillaStore } from '../primitives/HmsRoomProvider'; export const useAwayNotifications = () => { const vanillaStore = useHMSVanillaStore(); const requestPermission = useCallback(async () => { + if (navigator.userAgent.toLowerCase().includes('headless')) { + return; + } if (!Notification || Notification?.permission === 'granted' || Notification?.permission === 'denied') { return; } From 30ceee7c103f853cbfa3550de28bac970c6e7d5b Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Tue, 13 Aug 2024 19:30:25 +0530 Subject: [PATCH 2/2] fix: check --- packages/react-sdk/src/hooks/useAwayNotifications.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-sdk/src/hooks/useAwayNotifications.ts b/packages/react-sdk/src/hooks/useAwayNotifications.ts index 574fa08e93..cd72f9c3c5 100644 --- a/packages/react-sdk/src/hooks/useAwayNotifications.ts +++ b/packages/react-sdk/src/hooks/useAwayNotifications.ts @@ -7,7 +7,8 @@ import { useHMSVanillaStore } from '../primitives/HmsRoomProvider'; export const useAwayNotifications = () => { const vanillaStore = useHMSVanillaStore(); const requestPermission = useCallback(async () => { - if (navigator.userAgent.toLowerCase().includes('headless')) { + // Headless check for beam + if (navigator.webdriver) { return; } if (!Notification || Notification?.permission === 'granted' || Notification?.permission === 'denied') {