Iterate PR first round
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
6e674b97c2
commit
71e84ccb75
6 changed files with 9 additions and 8 deletions
|
@ -28,6 +28,7 @@ import BaseDialog from "./BaseDialog";
|
||||||
import DialogButtons from "../elements/DialogButtons";
|
import DialogButtons from "../elements/DialogButtons";
|
||||||
import { IDialogProps } from "./IDialogProps";
|
import { IDialogProps } from "./IDialogProps";
|
||||||
import { IGeneratedSas, ISasEvent } from "matrix-js-sdk/src/crypto/verification/SAS";
|
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_START = 0;
|
||||||
const PHASE_SHOW_SAS = 1;
|
const PHASE_SHOW_SAS = 1;
|
||||||
|
@ -36,7 +37,7 @@ const PHASE_VERIFIED = 3;
|
||||||
const PHASE_CANCELLED = 4;
|
const PHASE_CANCELLED = 4;
|
||||||
|
|
||||||
interface IProps extends IDialogProps {
|
interface IProps extends IDialogProps {
|
||||||
verifier: any; // TODO types
|
verifier: VerificationBase; // TODO types
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
|
@ -59,7 +60,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
let phase = PHASE_START;
|
let phase = PHASE_START;
|
||||||
if (this.props.verifier.cancelled) {
|
if (this.props.verifier.hasBeenCancelled) {
|
||||||
console.log("Verifier was cancelled in the background.");
|
console.log("Verifier was cancelled in the background.");
|
||||||
phase = PHASE_CANCELLED;
|
phase = PHASE_CANCELLED;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +80,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
public componentWillUnmount(): void {
|
public componentWillUnmount(): void {
|
||||||
if (this.state.phase !== PHASE_CANCELLED && this.state.phase !== PHASE_VERIFIED) {
|
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);
|
this.props.verifier.removeListener('show_sas', this.onVerifierShowSas);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ interface IProps extends IDialogProps {
|
||||||
host: string;
|
host: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LazyLoadingDisabledDialog: React.FC<IProps> = (props: IProps) => {
|
const LazyLoadingDisabledDialog: React.FC<IProps> = (props) => {
|
||||||
const brand = SdkConfig.get().brand;
|
const brand = SdkConfig.get().brand;
|
||||||
const description1 = _t(
|
const description1 = _t(
|
||||||
"You've previously used %(brand)s on %(host)s with lazy loading of members enabled. " +
|
"You've previously used %(brand)s on %(host)s with lazy loading of members enabled. " +
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { IDialogProps } from "./IDialogProps";
|
||||||
|
|
||||||
interface IProps extends IDialogProps {}
|
interface IProps extends IDialogProps {}
|
||||||
|
|
||||||
const LazyLoadingResyncDialog: React.FC<IProps> = (props: IProps) => {
|
const LazyLoadingResyncDialog: React.FC<IProps> = (props) => {
|
||||||
const brand = SdkConfig.get().brand;
|
const brand = SdkConfig.get().brand;
|
||||||
const description =
|
const description =
|
||||||
_t(
|
_t(
|
||||||
|
|
|
@ -35,7 +35,7 @@ interface IProps extends IDialogProps {
|
||||||
fixedWidth?: boolean;
|
fixedWidth?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
hasCancelButton?: boolean;
|
hasCancelButton?: boolean;
|
||||||
cancelButton?: JSX.Element;
|
cancelButton?: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class QuestionDialog extends React.Component<IProps> {
|
export default class QuestionDialog extends React.Component<IProps> {
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { IDialogProps } from "./IDialogProps";
|
||||||
|
|
||||||
interface IProps extends IDialogProps {
|
interface IProps extends IDialogProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string | JSX.Element;
|
description?: React.ReactNode;
|
||||||
value?: string;
|
value?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
button?: string;
|
button?: string;
|
||||||
|
|
|
@ -59,7 +59,7 @@ interface IState {
|
||||||
recoverInfo: IKeyBackupRestoreResult;
|
recoverInfo: IKeyBackupRestoreResult;
|
||||||
recoveryKeyValid: boolean;
|
recoveryKeyValid: boolean;
|
||||||
forceRecoveryKey: boolean;
|
forceRecoveryKey: boolean;
|
||||||
passPhrase: "";
|
passPhrase: string;
|
||||||
restoreType: RestoreType;
|
restoreType: RestoreType;
|
||||||
progress: {
|
progress: {
|
||||||
stage: ProgressState;
|
stage: ProgressState;
|
||||||
|
|
Loading…
Reference in a new issue