From 4a182e89b0bdda2aa71918b611ca742e93a92d84 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:28:23 +0000 Subject: [PATCH] VerificationExplorer: remove reference to internal class (#12362) * VerificationExplorer: remove reference to internal class The legacy `VerificationRequest` is an internal class. * handle null timeout --- .../dialogs/devtools/VerificationExplorer.tsx | 15 ++++++++------- src/i18n/strings/en_EN.json | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/views/dialogs/devtools/VerificationExplorer.tsx b/src/components/views/dialogs/devtools/VerificationExplorer.tsx index dd9a4b0ee2..aad806d27f 100644 --- a/src/components/views/dialogs/devtools/VerificationExplorer.tsx +++ b/src/components/views/dialogs/devtools/VerificationExplorer.tsx @@ -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<{
{_t("devtools|phase")}
{PHASE_MAP[request.phase] ? _t(PHASE_MAP[request.phase]) : request.phase}
{_t("devtools|timeout")}
-
{Math.floor(timeout / 1000)}
+
{timeout === null ? _t("devtools|timeout_none") : Math.floor(timeout / 1000)}
{_t("devtools|methods")}
{request.methods && request.methods.join(", ")}
-
{_t("devtools|requester")}
-
{request.requestingUserId}
-
{_t("devtools|observe_only")}
-
{JSON.stringify(request.observeOnly)}
+
{_t("devtools|other_user")}
+
{request.otherUserId}
); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 0768dfb9de..3cebc61cae 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -742,15 +742,14 @@ "notification_state": "Notification state is %(notificationState)s", "notifications_debug": "Notifications debug", "number_of_users": "Number of users", - "observe_only": "Observe only", "original_event_source": "Original event source", + "other_user": "Other user", "phase": "Phase", "phase_cancelled": "Cancelled", "phase_ready": "Ready", "phase_requested": "Requested", "phase_started": "Started", "phase_transaction": "Transaction", - "requester": "Requester", "room_encrypted": "Room is encrypted ✅", "room_id": "Room ID: %(roomId)s", "room_not_encrypted": "Room is not encrypted 🚨", @@ -789,6 +788,7 @@ "thread_root_id": "Thread Root ID: %(threadRootId)s", "threads_timeline": "Threads timeline", "timeout": "Timeout", + "timeout_none": "None", "title": "Developer tools", "toggle_event": "toggle event", "toolbox": "Toolbox",