From 400cb3324798db72e26160cdd4174e6d8f5b4ea8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Feb 2020 12:35:34 +0100 Subject: [PATCH] put state declaration on top --- src/components/views/right_panel/EncryptionPanel.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/views/right_panel/EncryptionPanel.js b/src/components/views/right_panel/EncryptionPanel.js index 3e9fa4f8b2..4723211de4 100644 --- a/src/components/views/right_panel/EncryptionPanel.js +++ b/src/components/views/right_panel/EncryptionPanel.js @@ -32,7 +32,9 @@ const MISMATCHES = ["m.key_mismatch", "m.user_error", "m.mismatched_sas"]; const EncryptionPanel = ({verificationRequest, member, onClose, layout}) => { const [request, setRequest] = useState(verificationRequest); - + // state to show a spinner immediately after clicking "start verification", + // before we have a request + const [isRequesting, setRequesting] = useState(false); const [phase, setPhase] = useState(request && request.phase); useEffect(() => { setRequest(verificationRequest); @@ -68,9 +70,6 @@ const EncryptionPanel = ({verificationRequest, member, onClose, layout}) => { }, [onClose, request]); useEventEmitter(request, "change", changeHandler); - // state to show a spinner immediately after clicking "start verification", - // before we have a request - const [isRequesting, setRequesting] = useState(false); const onStartVerification = useCallback(async () => { setRequesting(true); const cli = MatrixClientPeg.get();