From c24b0e5ed353be61f3b76134b2fe737ed84cea2b Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Wed, 9 Oct 2024 19:59:25 -0300 Subject: [PATCH] regression: voip beforeunload listener being added instead of removed (#33511) --- packages/ui-voip/src/providers/VoipProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui-voip/src/providers/VoipProvider.tsx b/packages/ui-voip/src/providers/VoipProvider.tsx index a4f25bc700a1..28133abd8698 100644 --- a/packages/ui-voip/src/providers/VoipProvider.tsx +++ b/packages/ui-voip/src/providers/VoipProvider.tsx @@ -103,7 +103,7 @@ const VoipProvider = ({ children }: { children: ReactNode }) => { voipClient.networkEmitter.off('disconnected', onNetworkDisconnected); voipClient.networkEmitter.off('connectionerror', onNetworkDisconnected); voipClient.networkEmitter.off('localnetworkoffline', onNetworkDisconnected); - window.addEventListener('beforeunload', onBeforeUnload); + window.removeEventListener('beforeunload', onBeforeUnload); }; }, [dispatchToastMessage, setStorageRegistered, t, voipClient, voipSounds]);