Fix various races that prevented the right panel being in the right state for verifications

Fixes https://github.com/vector-im/riot-web/issues/11989
This commit is contained in:
David Baker 2020-01-29 16:56:12 +00:00
parent d8ca9d0f13
commit e403169e13
2 changed files with 22 additions and 2 deletions

View file

@ -36,7 +36,7 @@ const EncryptionPanel = ({verificationRequest, member, onClose}) => {
setRequest(verificationRequest);
}, [verificationRequest]);
const [phase, setPhase] = useState(undefined);
const [phase, setPhase] = useState(request.phase);
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)) {