From 3b0de577cd0f8e6f084a2837c97ada519bf01312 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:00:55 -0500 Subject: [PATCH] Fix GroupCallRemoteParticipant error dialog to retain error message Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> --- .../GroupCallRemoteParticipant.stories.tsx | 40 ++++++++++ ts/components/GroupCallRemoteParticipant.tsx | 76 ++++++++++++------- 2 files changed, 90 insertions(+), 26 deletions(-) diff --git a/ts/components/GroupCallRemoteParticipant.stories.tsx b/ts/components/GroupCallRemoteParticipant.stories.tsx index 639ebfa479..f02846ea68 100644 --- a/ts/components/GroupCallRemoteParticipant.stories.tsx +++ b/ts/components/GroupCallRemoteParticipant.stories.tsx @@ -192,3 +192,43 @@ export function NoMediaKeys(): JSX.Element { /> ); } + +export function NoMediaKeysBlockedIntermittent(): JSX.Element { + const [isBlocked, setIsBlocked] = React.useState(false); + React.useEffect(() => { + const interval = setInterval(() => { + setIsBlocked(value => !value); + }, 6000); + + return () => clearInterval(interval); + }, [isBlocked]); + + const [mediaKeysReceived, setMediaKeysReceived] = React.useState(false); + React.useEffect(() => { + const interval = setInterval(() => { + setMediaKeysReceived(value => !value); + }, 3000); + + return () => clearInterval(interval); + }, [mediaKeysReceived]); + + return ( + + ); +} diff --git a/ts/components/GroupCallRemoteParticipant.tsx b/ts/components/GroupCallRemoteParticipant.tsx index 42c26cbe8d..cf4b1d32f9 100644 --- a/ts/components/GroupCallRemoteParticipant.tsx +++ b/ts/components/GroupCallRemoteParticipant.tsx @@ -304,8 +304,6 @@ export const GroupCallRemoteParticipant: React.FC = React.memo( } let noVideoNode: ReactNode; - let errorDialogTitle: ReactNode; - let errorDialogBody = ''; if (!hasVideoToShow) { const showDialogButton = (