VerificationExplorer: remove reference to internal class (#12362)

* VerificationExplorer: remove reference to internal class

The legacy `VerificationRequest` is an internal class.

* handle null timeout
This commit is contained in:
Richard van der Hoff 2024-03-22 12:28:23 +00:00 committed by GitHub
parent d36c1b39fd
commit 4a182e89b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 9 deletions

View file

@ -16,8 +16,11 @@ limitations under the License.
*/
import React, { useContext, useEffect, useState } from "react";
import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
import { VerificationPhase as Phase, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api";
import {
VerificationPhase as Phase,
VerificationRequest,
VerificationRequestEvent,
} from "matrix-js-sdk/src/crypto-api";
import { CryptoEvent } from "matrix-js-sdk/src/crypto";
import { useTypedEventEmitter, useTypedEventEmitterState } from "../../../../hooks/useEventEmitter";
@ -67,13 +70,11 @@ const VerificationRequestExplorer: React.FC<{
<dt>{_t("devtools|phase")}</dt>
<dd>{PHASE_MAP[request.phase] ? _t(PHASE_MAP[request.phase]) : request.phase}</dd>
<dt>{_t("devtools|timeout")}</dt>
<dd>{Math.floor(timeout / 1000)}</dd>
<dd>{timeout === null ? _t("devtools|timeout_none") : Math.floor(timeout / 1000)}</dd>
<dt>{_t("devtools|methods")}</dt>
<dd>{request.methods && request.methods.join(", ")}</dd>
<dt>{_t("devtools|requester")}</dt>
<dd>{request.requestingUserId}</dd>
<dt>{_t("devtools|observe_only")}</dt>
<dd>{JSON.stringify(request.observeOnly)}</dd>
<dt>{_t("devtools|other_user")}</dt>
<dd>{request.otherUserId}</dd>
</dl>
</div>
);