From d824145638adba42a753bb1518b4335c0758b487 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 29 Jan 2020 07:54:10 +0000 Subject: [PATCH] show as pending whilst in an empty state until told better to prevent a flash --- src/components/views/right_panel/EncryptionPanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/right_panel/EncryptionPanel.js b/src/components/views/right_panel/EncryptionPanel.js index d45280e29c..4e147bd7a5 100644 --- a/src/components/views/right_panel/EncryptionPanel.js +++ b/src/components/views/right_panel/EncryptionPanel.js @@ -36,7 +36,7 @@ const EncryptionPanel = ({verificationRequest, member, onClose}) => { setRequest(verificationRequest); }, [verificationRequest]); - const [phase, setPhase] = useState(false); + const [phase, setPhase] = useState(undefined); const changeHandler = useCallback(() => { // handle transitions -> cancelled for mismatches which fire a modal instead of showing a card if (request && request.cancelled && MISMATCHES.includes(request.cancellationCode)) { @@ -71,7 +71,7 @@ const EncryptionPanel = ({verificationRequest, member, onClose}) => { setRequest(verificationRequest); }, [member.userId]); - const requested = request && phase === PHASE_REQUESTED; + const requested = request && (phase === PHASE_REQUESTED || phase === undefined); if (!request || requested) { return ; } else {