Merge branch 'develop' into t3chguy/ts/4

This commit is contained in:
Michael Telatynski 2021-06-29 22:24:47 +01:00 committed by GitHub
commit 6250d9ba61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
693 changed files with 4996 additions and 5258 deletions

View file

@ -14,18 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {debounce} from "lodash";
import { debounce } from "lodash";
import classNames from 'classnames';
import React, {ChangeEvent, FormEvent} from 'react';
import {ISecretStorageKeyInfo} from "matrix-js-sdk/src";
import React, { ChangeEvent, FormEvent } from 'react';
import { ISecretStorageKeyInfo } from "matrix-js-sdk/src";
import * as sdk from '../../../../index';
import {MatrixClientPeg} from '../../../../MatrixClientPeg';
import { MatrixClientPeg } from '../../../../MatrixClientPeg';
import Field from '../../elements/Field';
import AccessibleButton from '../../elements/AccessibleButton';
import {_t} from '../../../../languageHandler';
import {IDialogProps} from "../IDialogProps";
import {accessSecretStorage} from "../../../../SecurityManager";
import { _t } from '../../../../languageHandler';
import { IDialogProps } from "../IDialogProps";
import { accessSecretStorage } from "../../../../SecurityManager";
import Modal from "../../../../Modal";
// Maximum acceptable size of a key file. It's 59 characters including the spaces we encode,
@ -75,7 +75,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
private onCancel = () => {
if (this.state.resetting) {
this.setState({resetting: false});
this.setState({ resetting: false });
}
this.props.onFinished(false);
};
@ -169,7 +169,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
private onRecoveryKeyFileUploadClick = () => {
this.fileUpload.current.click();
}
};
private onPassPhraseNext = async (ev: FormEvent<HTMLFormElement>) => {
ev.preventDefault();
@ -210,7 +210,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
private onResetAllClick = (ev: React.MouseEvent<HTMLAnchorElement>) => {
ev.preventDefault();
this.setState({resetting: true});
this.setState({ resetting: true });
};
private onConfirmResetAllClick = async () => {
@ -231,7 +231,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
authUploadDeviceSigningKeys: async (makeRequest) => {
// XXX: Making this an import breaks the app.
const InteractiveAuthDialog = sdk.getComponent("views.dialogs.InteractiveAuthDialog");
const {finished} = Modal.createTrackedDialog(
const { finished } = Modal.createTrackedDialog(
'Cross-signing keys dialog', '', InteractiveAuthDialog,
{
title: _t("Setting up keys"),

View file

@ -141,7 +141,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
throw new Error("Cross-signing key upload auth canceled");
}
}
}
};
private bootstrapCrossSigning = async (): Promise<void> => {
this.setState({
@ -165,11 +165,11 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
this.setState({ error: e });
console.error("Error bootstrapping cross-signing", e);
}
}
};
private onCancel = (): void => {
this.props.onFinished(false);
}
};
render() {
let content;

View file

@ -18,7 +18,7 @@ limitations under the License.
import React from 'react';
import PropTypes from 'prop-types';
import * as sdk from '../../../../index';
import {MatrixClientPeg} from '../../../../MatrixClientPeg';
import { MatrixClientPeg } from '../../../../MatrixClientPeg';
import { MatrixClient } from 'matrix-js-sdk/src/client';
import { _t } from '../../../../languageHandler';
import { accessSecretStorage } from '../../../../SecurityManager';
@ -327,11 +327,11 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
if (this.state.recoverInfo.total > this.state.recoverInfo.imported) {
failedToDecrypt = <p>{_t(
"Failed to decrypt %(failedCount)s sessions!",
{failedCount: this.state.recoverInfo.total - this.state.recoverInfo.imported},
{ failedCount: this.state.recoverInfo.total - this.state.recoverInfo.imported },
)}</p>;
}
content = <div>
<p>{_t("Successfully restored %(sessionCount)s keys", {sessionCount: this.state.recoverInfo.imported})}</p>
<p>{_t("Successfully restored %(sessionCount)s keys", { sessionCount: this.state.recoverInfo.imported })}</p>
{failedToDecrypt}
<DialogButtons primaryButton={_t('OK')}
onPrimaryButtonClick={this._onDone}

View file

@ -19,7 +19,7 @@ import SetupEncryptionBody from '../../../structures/auth/SetupEncryptionBody';
import BaseDialog from '../BaseDialog';
import { _t } from '../../../../languageHandler';
import { SetupEncryptionStore, Phase } from '../../../../stores/SetupEncryptionStore';
import {replaceableComponent} from "../../../../utils/replaceableComponent";
import { replaceableComponent } from "../../../../utils/replaceableComponent";
function iconFromPhase(phase: Phase) {
if (phase === Phase.Done) {
@ -45,7 +45,7 @@ export default class SetupEncryptionDialog extends React.Component<IProps, IStat
super(props);
this.store = SetupEncryptionStore.sharedInstance();
this.state = {icon: iconFromPhase(this.store.phase)};
this.state = { icon: iconFromPhase(this.store.phase) };
}
public componentDidMount() {
@ -57,7 +57,7 @@ export default class SetupEncryptionDialog extends React.Component<IProps, IStat
}
private onStoreUpdate = (): void => {
this.setState({icon: iconFromPhase(this.store.phase)});
this.setState({ icon: iconFromPhase(this.store.phase) });
};
public render() {