From ffb1fe2590794d0ba9a0feb15c6fcc2889cb59ae Mon Sep 17 00:00:00 2001
From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
Date: Tue, 19 Mar 2024 09:41:05 -0700
Subject: [PATCH] Fix GroupCallRemoteParticipant error dialog to retain error
message
---
.../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 = (