Provide separate translatable for case where we have no device
parent
3c5c7f56f3
commit
ae2645b69b
|
@ -229,13 +229,14 @@ export default class VerificationPanel extends React.PureComponent {
|
||||||
if (!device) {
|
if (!device) {
|
||||||
// This can happen if the device is logged out while we're still showing verification
|
// This can happen if the device is logged out while we're still showing verification
|
||||||
// UI for it.
|
// UI for it.
|
||||||
// Leave the message slightly broken for this edge case (avoid adding a translatable string)
|
|
||||||
console.warn("Verified device we don't know about: " + this.props.request.channel.deviceId);
|
console.warn("Verified device we don't know about: " + this.props.request.channel.deviceId);
|
||||||
|
description = _t("You've successfully verified your device!");
|
||||||
|
} else {
|
||||||
|
description = _t("You've successfully verified %(deviceName)s (%(deviceId)s)!", {
|
||||||
|
deviceName: device ? device.getDisplayName() : '',
|
||||||
|
deviceId: this.props.request.channel.deviceId,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
description = _t("You've successfully verified %(deviceName)s (%(deviceId)s)!", {
|
|
||||||
deviceName: device ? device.getDisplayName() : '',
|
|
||||||
deviceId: this.props.request.channel.deviceId,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
description = _t("You've successfully verified %(displayName)s!", {
|
description = _t("You've successfully verified %(displayName)s!", {
|
||||||
displayName: member.displayName || member.name || member.userId,
|
displayName: member.displayName || member.name || member.userId,
|
||||||
|
|
|
@ -117,12 +117,16 @@ export default class VerificationShowSas extends React.Component {
|
||||||
let text;
|
let text;
|
||||||
if (this.state.pending) {
|
if (this.state.pending) {
|
||||||
if (this.props.isSelf) {
|
if (this.props.isSelf) {
|
||||||
// device shouldn't be null in this situation but it seems like it can be, so show
|
// device shouldn't be null in this situation but it can be, eg. if the device is
|
||||||
// slightly broken text rather than soft-crashing (we've already logged in VerificationPanel).
|
// logged out during verification
|
||||||
text = _t("Waiting for your other session, %(deviceName)s (%(deviceId)s), to verify…", {
|
if (this.props.device) {
|
||||||
deviceName: this.props.device ? this.props.device.getDisplayName() : '',
|
text = _t("Waiting for your other session, %(deviceName)s (%(deviceId)s), to verify…", {
|
||||||
deviceId: this.props.device ? this.props.device.deviceId : '',
|
deviceName: this.props.device ? this.props.device.getDisplayName() : '',
|
||||||
});
|
deviceId: this.props.device ? this.props.device.deviceId : '',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
text = _t("Waiting for your other session to verify…");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const {displayName} = this.props;
|
const {displayName} = this.props;
|
||||||
text = _t("Waiting for %(displayName)s to verify…", {displayName});
|
text = _t("Waiting for %(displayName)s to verify…", {displayName});
|
||||||
|
|
Loading…
Reference in New Issue