From 3d2a752a788cbcb77f327af653a9cced6107f8a9 Mon Sep 17 00:00:00 2001 From: Kimberlee Johnson Date: Tue, 7 Dec 2021 11:06:44 -0800 Subject: [PATCH 1/2] Simplify roomConfig check --- custom/shared/contexts/CallProvider.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/shared/contexts/CallProvider.js b/custom/shared/contexts/CallProvider.js index 62b6919..5965113 100644 --- a/custom/shared/contexts/CallProvider.js +++ b/custom/shared/contexts/CallProvider.js @@ -52,9 +52,10 @@ export const CallProvider = ({ if (!daily) return; const updateRoomConfigState = async () => { const roomConfig = await daily.room(); - if (!('config' in roomConfig)) return; + const config = roomConfig?.config; + if (!config) return; - if (roomConfig?.config?.exp) { + if (config.exp) { setRoomExp( roomConfig?.config?.exp * 1000 || Date.now() + 1 * 60 * 1000 ); From 3092cfb59620e6fa05a125ffe314e62acd770064 Mon Sep 17 00:00:00 2001 From: Kimberlee Johnson Date: Wed, 8 Dec 2021 09:33:35 -0800 Subject: [PATCH 2/2] Updated roomConfig check to use existing variable --- custom/shared/contexts/CallProvider.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/custom/shared/contexts/CallProvider.js b/custom/shared/contexts/CallProvider.js index 5965113..5e8ad4d 100644 --- a/custom/shared/contexts/CallProvider.js +++ b/custom/shared/contexts/CallProvider.js @@ -56,9 +56,7 @@ export const CallProvider = ({ if (!config) return; if (config.exp) { - setRoomExp( - roomConfig?.config?.exp * 1000 || Date.now() + 1 * 60 * 1000 - ); + setRoomExp(config.exp * 1000 || Date.now() + 1 * 60 * 1000); } const browser = Bowser.parse(window.navigator.userAgent); const recordingType =