From 7f90489160710001a873a8229454d82fc993bc06 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 15 Jun 2021 17:37:10 +0100 Subject: [PATCH] added call ended to useCallUI --- dailyjs/shared/hooks/useCallUI.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dailyjs/shared/hooks/useCallUI.js b/dailyjs/shared/hooks/useCallUI.js index 65ef647..b8feaec 100644 --- a/dailyjs/shared/hooks/useCallUI.js +++ b/dailyjs/shared/hooks/useCallUI.js @@ -19,6 +19,7 @@ export const useCallUI = ({ room, haircheck, redirectUrl, + callEnded, notFoundRedirect = 'not-found', }) => { const router = useRouter(); @@ -57,8 +58,9 @@ export const useCallUI = ({ ); case CALL_STATE_ENDED: - // Note: you could set a manual redirect here but we'll show just an exit screen - return ( + return callEnded ? ( + callEnded() + ) : ( window.location.reload()}> You have left the call. We hope you had fun! @@ -72,7 +74,15 @@ export const useCallUI = ({ An unknown error has occured in the call loop. This should not happen! ); - }, [state, notFoundRedirect, redirectUrl, haircheck, room, router]); + }, [ + state, + notFoundRedirect, + redirectUrl, + haircheck, + room, + callEnded, + router, + ]); return renderByState; };