From d44d7075ab6e890f28ffc0457ec51b2001219c30 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Thu, 30 Jan 2025 08:59:32 +0100 Subject: [PATCH] fix: remove nullish coalescing operator --- frontend/src/contexts/broadcast-channel.context.tsx | 2 +- widget/src/providers/BroadcastChannelProvider.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/contexts/broadcast-channel.context.tsx b/frontend/src/contexts/broadcast-channel.context.tsx index 3cdfdf8a..885e6030 100644 --- a/frontend/src/contexts/broadcast-channel.context.tsx +++ b/frontend/src/contexts/broadcast-channel.context.tsx @@ -103,7 +103,7 @@ export const BroadcastChannelProvider: FC = ({ subscribersRef.current[event].push(callback); return () => { - const index = subscribersRef.current[event].indexOf(callback) ?? -1; + const index = subscribersRef.current[event].indexOf(callback); if (index !== -1) { subscribersRef.current[event].splice(index, 1); diff --git a/widget/src/providers/BroadcastChannelProvider.tsx b/widget/src/providers/BroadcastChannelProvider.tsx index 5206f643..12907889 100644 --- a/widget/src/providers/BroadcastChannelProvider.tsx +++ b/widget/src/providers/BroadcastChannelProvider.tsx @@ -105,7 +105,7 @@ export const BroadcastChannelProvider: FC = ({ subscribersRef.current[event].push(callback); return () => { - const index = subscribersRef.current[event].indexOf(callback) ?? -1; + const index = subscribersRef.current[event].indexOf(callback); if (index !== -1) { subscribersRef.current[event].splice(index, 1);