From 71e84ccb75aeb002b236d9c73c867496b5c89e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 13 Sep 2021 18:03:05 +0200 Subject: [PATCH] Iterate PR first round MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/dialogs/IncomingSasDialog.tsx | 7 ++++--- src/components/views/dialogs/LazyLoadingDisabledDialog.tsx | 2 +- src/components/views/dialogs/LazyLoadingResyncDialog.tsx | 2 +- src/components/views/dialogs/QuestionDialog.tsx | 2 +- src/components/views/dialogs/TextInputDialog.tsx | 2 +- .../views/dialogs/security/RestoreKeyBackupDialog.tsx | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/views/dialogs/IncomingSasDialog.tsx b/src/components/views/dialogs/IncomingSasDialog.tsx index e81a233055..0e9d8cbf4e 100644 --- a/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/src/components/views/dialogs/IncomingSasDialog.tsx @@ -28,6 +28,7 @@ import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; import { IDialogProps } from "./IDialogProps"; import { IGeneratedSas, ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS"; +import { VerificationBase } from "matrix-js-sdk/src/crypto/verification/Base"; const PHASE_START = 0; const PHASE_SHOW_SAS = 1; @@ -36,7 +37,7 @@ const PHASE_VERIFIED = 3; const PHASE_CANCELLED = 4; interface IProps extends IDialogProps { - verifier: any; // TODO types + verifier: VerificationBase; // TODO types } interface IState { @@ -59,7 +60,7 @@ export default class IncomingSasDialog extends React.Component { super(props); let phase = PHASE_START; - if (this.props.verifier.cancelled) { + if (this.props.verifier.hasBeenCancelled) { console.log("Verifier was cancelled in the background."); phase = PHASE_CANCELLED; } @@ -79,7 +80,7 @@ export default class IncomingSasDialog extends React.Component { public componentWillUnmount(): void { if (this.state.phase !== PHASE_CANCELLED && this.state.phase !== PHASE_VERIFIED) { - this.props.verifier.cancel('User cancel'); + this.props.verifier.cancel(new Error('User cancel')); } this.props.verifier.removeListener('show_sas', this.onVerifierShowSas); } diff --git a/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx b/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx index 76e7407173..ec30123436 100644 --- a/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx +++ b/src/components/views/dialogs/LazyLoadingDisabledDialog.tsx @@ -25,7 +25,7 @@ interface IProps extends IDialogProps { host: string; } -const LazyLoadingDisabledDialog: React.FC = (props: IProps) => { +const LazyLoadingDisabledDialog: React.FC = (props) => { const brand = SdkConfig.get().brand; const description1 = _t( "You've previously used %(brand)s on %(host)s with lazy loading of members enabled. " + diff --git a/src/components/views/dialogs/LazyLoadingResyncDialog.tsx b/src/components/views/dialogs/LazyLoadingResyncDialog.tsx index 3acedc77e4..e6a505511c 100644 --- a/src/components/views/dialogs/LazyLoadingResyncDialog.tsx +++ b/src/components/views/dialogs/LazyLoadingResyncDialog.tsx @@ -23,7 +23,7 @@ import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps {} -const LazyLoadingResyncDialog: React.FC = (props: IProps) => { +const LazyLoadingResyncDialog: React.FC = (props) => { const brand = SdkConfig.get().brand; const description = _t( diff --git a/src/components/views/dialogs/QuestionDialog.tsx b/src/components/views/dialogs/QuestionDialog.tsx index 8c6334bac1..aaddff34ed 100644 --- a/src/components/views/dialogs/QuestionDialog.tsx +++ b/src/components/views/dialogs/QuestionDialog.tsx @@ -35,7 +35,7 @@ interface IProps extends IDialogProps { fixedWidth?: boolean; className?: string; hasCancelButton?: boolean; - cancelButton?: JSX.Element; + cancelButton?: React.ReactNode; } export default class QuestionDialog extends React.Component { diff --git a/src/components/views/dialogs/TextInputDialog.tsx b/src/components/views/dialogs/TextInputDialog.tsx index cc321a0af6..7a5887f053 100644 --- a/src/components/views/dialogs/TextInputDialog.tsx +++ b/src/components/views/dialogs/TextInputDialog.tsx @@ -25,7 +25,7 @@ import { IDialogProps } from "./IDialogProps"; interface IProps extends IDialogProps { title?: string; - description?: string | JSX.Element; + description?: React.ReactNode; value?: string; placeholder?: string; button?: string; diff --git a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index 7d5c3cf857..afeec726b6 100644 --- a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -59,7 +59,7 @@ interface IState { recoverInfo: IKeyBackupRestoreResult; recoveryKeyValid: boolean; forceRecoveryKey: boolean; - passPhrase: ""; + passPhrase: string; restoreType: RestoreType; progress: { stage: ProgressState;