From 2127edb7b8007092ec30648db0e0f8ebba3253c8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 25 Feb 2020 13:13:51 +0100 Subject: [PATCH] show "Waiting for network" in EncryptionInfo after accepting in toast --- .../views/right_panel/EncryptionInfo.js | 15 ++++++++++----- .../views/right_panel/EncryptionPanel.js | 7 ++++++- src/i18n/strings/en_EN.json | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/views/right_panel/EncryptionInfo.js b/src/components/views/right_panel/EncryptionInfo.js index 299e553769..3638e1058f 100644 --- a/src/components/views/right_panel/EncryptionInfo.js +++ b/src/components/views/right_panel/EncryptionInfo.js @@ -28,12 +28,17 @@ export const PendingActionSpinner = ({text}) => { ; }; -const EncryptionInfo = ({pending, member, onStartVerification}) => { +const EncryptionInfo = ({waitingForOtherParty, waitingForNetwork, member, onStartVerification}) => { let content; - if (pending) { - const text = _t("Waiting for %(displayName)s to accept…", { - displayName: member.displayName || member.name || member.userId, - }); + if (waitingForOtherParty || waitingForNetwork) { + let text; + if (waitingForOtherParty) { + text = _t("Waiting for %(displayName)s to accept…", { + displayName: member.displayName || member.name || member.userId, + }); + } else { + text = _t("Waiting for network…"); + } content = ; } else { const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); diff --git a/src/components/views/right_panel/EncryptionPanel.js b/src/components/views/right_panel/EncryptionPanel.js index 24d2f9f010..3ba6ca9a8a 100644 --- a/src/components/views/right_panel/EncryptionPanel.js +++ b/src/components/views/right_panel/EncryptionPanel.js @@ -76,8 +76,13 @@ const EncryptionPanel = ({verificationRequest, member, onClose, layout}) => { }, [member.userId]); const requested = request && (phase === PHASE_REQUESTED || phase === PHASE_UNSENT || phase === undefined); + const initiatedByMe = request && request.initiatedByMe; if (!request || requested) { - return ; + return ; } else { return (