Inline VerificationRequest.{invalid,ready,started,done,cancelled}
(#11013)
* Inline `VerificationRequest.{invalid,ready,started,done,cancelled}` These methods are all just shortcuts for checks on `phase`, so let's get rid of them * update test * Add some more tests * even more coverage * fix tests
This commit is contained in:
parent
6fa005dcfc
commit
2801afe570
7 changed files with 210 additions and 35 deletions
|
@ -18,6 +18,7 @@ import React, { useCallback, useEffect, useState } from "react";
|
|||
import {
|
||||
PHASE_REQUESTED,
|
||||
PHASE_UNSENT,
|
||||
Phase as VerificationPhase,
|
||||
VerificationRequest,
|
||||
VerificationRequestEvent,
|
||||
} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
|
||||
|
@ -76,7 +77,7 @@ const EncryptionPanel: React.FC<IProps> = (props: IProps) => {
|
|||
}, [verificationRequestPromise]);
|
||||
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)) {
|
||||
if (request && request.phase === VerificationPhase.Cancelled && MISMATCHES.includes(request.cancellationCode)) {
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
headerImage: require("../../../../res/img/e2e/warning-deprecated.svg").default,
|
||||
title: _t("Your messages are not secure"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue