show "Waiting for network" in EncryptionInfo after accepting in toast

This commit is contained in:
Bruno Windels 2020-02-25 13:13:51 +01:00
parent 569d5b6156
commit 2127edb7b8
3 changed files with 17 additions and 6 deletions

View file

@ -28,12 +28,17 @@ export const PendingActionSpinner = ({text}) => {
</div>; </div>;
}; };
const EncryptionInfo = ({pending, member, onStartVerification}) => { const EncryptionInfo = ({waitingForOtherParty, waitingForNetwork, member, onStartVerification}) => {
let content; let content;
if (pending) { if (waitingForOtherParty || waitingForNetwork) {
const text = _t("Waiting for %(displayName)s to accept…", { let text;
if (waitingForOtherParty) {
text = _t("Waiting for %(displayName)s to accept…", {
displayName: member.displayName || member.name || member.userId, displayName: member.displayName || member.name || member.userId,
}); });
} else {
text = _t("Waiting for network…");
}
content = <PendingActionSpinner text={text} />; content = <PendingActionSpinner text={text} />;
} else { } else {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const AccessibleButton = sdk.getComponent('elements.AccessibleButton');

View file

@ -76,8 +76,13 @@ const EncryptionPanel = ({verificationRequest, member, onClose, layout}) => {
}, [member.userId]); }, [member.userId]);
const requested = request && (phase === PHASE_REQUESTED || phase === PHASE_UNSENT || phase === undefined); const requested = request && (phase === PHASE_REQUESTED || phase === PHASE_UNSENT || phase === undefined);
const initiatedByMe = request && request.initiatedByMe;
if (!request || requested) { if (!request || requested) {
return <EncryptionInfo onStartVerification={onStartVerification} member={member} pending={requested} />; return <EncryptionInfo
onStartVerification={onStartVerification}
member={member}
waitingForOtherParty={requested && initiatedByMe}
waitingForNetwork={requested && !initiatedByMe} />;
} else { } else {
return ( return (
<VerificationPanel <VerificationPanel

View file

@ -1165,6 +1165,7 @@
"In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.": "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.", "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.": "In encrypted rooms, like this one, URL previews are disabled by default to ensure that your homeserver (where the previews are generated) cannot gather information about links you see in this room.",
"When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.": "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.", "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.": "When someone puts a URL in their message, a URL preview can be shown to give more information about that link such as the title, description, and an image from the website.",
"Waiting for %(displayName)s to accept…": "Waiting for %(displayName)s to accept…", "Waiting for %(displayName)s to accept…": "Waiting for %(displayName)s to accept…",
"Waiting for network…": "Waiting for network…",
"Start Verification": "Start Verification", "Start Verification": "Start Verification",
"Messages in this room are end-to-end encrypted.": "Messages in this room are end-to-end encrypted.", "Messages in this room are end-to-end encrypted.": "Messages in this room are end-to-end encrypted.",
"Your messages are secured and only you and the recipient have the unique keys to unlock them.": "Your messages are secured and only you and the recipient have the unique keys to unlock them.", "Your messages are secured and only you and the recipient have the unique keys to unlock them.": "Your messages are secured and only you and the recipient have the unique keys to unlock them.",