This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,11 @@ const EncryptionPanel: React.FC<IProps> = (props: IProps) => {
71
71
} , [ verificationRequestPromise ] ) ;
72
72
const changeHandler = useCallback ( ( ) => {
73
73
// handle transitions -> cancelled for mismatches which fire a modal instead of showing a card
74
- if ( request && request . phase === VerificationPhase . Cancelled && MISMATCHES . includes ( request . cancellationCode ) ) {
74
+ if (
75
+ request &&
76
+ request . phase === VerificationPhase . Cancelled &&
77
+ MISMATCHES . includes ( request . cancellationCode ?? "" )
78
+ ) {
75
79
Modal . createDialog ( ErrorDialog , {
76
80
headerImage : require ( "../../../../res/img/e2e/warning-deprecated.svg" ) . default ,
77
81
title : _t ( "Your messages are not secure" ) ,
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ interface IProps {
42
42
}
43
43
44
44
interface IState {
45
+ /** number of seconds left in the timeout counter. Zero if there is no timeout. */
45
46
counter : number ;
46
47
device ?: DeviceInfo ;
47
48
ip ?: string ;
@@ -52,7 +53,7 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
52
53
53
54
public constructor ( props : IProps ) {
54
55
super ( props ) ;
55
- this . state = { counter : Math . ceil ( props . request . timeout / 1000 ) } ;
56
+ this . state = { counter : Math . ceil ( ( props . request . timeout ?? 0 ) / 1000 ) } ;
56
57
}
57
58
58
59
public async componentDidMount ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments