Allow for unknown event shield reasons (#30397)
A forthcoming change to the js-sdk will add a new event shield reason. To avoid a compile-time failure, add a `default` case to the code handling those reasons.
This commit is contained in:
@@ -729,11 +729,6 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
|
|||||||
if (this.state.shieldColour !== EventShieldColour.NONE) {
|
if (this.state.shieldColour !== EventShieldColour.NONE) {
|
||||||
let shieldReasonMessage: string;
|
let shieldReasonMessage: string;
|
||||||
switch (this.state.shieldReason) {
|
switch (this.state.shieldReason) {
|
||||||
case null:
|
|
||||||
case EventShieldReason.UNKNOWN:
|
|
||||||
shieldReasonMessage = _t("error|unknown");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EventShieldReason.UNVERIFIED_IDENTITY:
|
case EventShieldReason.UNVERIFIED_IDENTITY:
|
||||||
shieldReasonMessage = _t("encryption|event_shield_reason_unverified_identity");
|
shieldReasonMessage = _t("encryption|event_shield_reason_unverified_identity");
|
||||||
break;
|
break;
|
||||||
@@ -761,6 +756,10 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
|
|||||||
case EventShieldReason.VERIFICATION_VIOLATION:
|
case EventShieldReason.VERIFICATION_VIOLATION:
|
||||||
shieldReasonMessage = _t("timeline|decryption_failure|sender_identity_previously_verified");
|
shieldReasonMessage = _t("timeline|decryption_failure|sender_identity_previously_verified");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
shieldReasonMessage = _t("error|unknown");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.shieldColour === EventShieldColour.GREY) {
|
if (this.state.shieldColour === EventShieldColour.GREY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user