Conform more of the codebase to strict types (#11191)
This commit is contained in:
parent
4044c2aa66
commit
8107f1d271
25 changed files with 88 additions and 57 deletions
|
@ -18,7 +18,8 @@ limitations under the License.
|
|||
import React from "react";
|
||||
import { CrossSigningKeys } from "matrix-js-sdk/src/client";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { UIAFlow } from "matrix-js-sdk/src/matrix";
|
||||
import { AuthDict, MatrixError, UIAFlow } from "matrix-js-sdk/src/matrix";
|
||||
import { UIAResponse } from "matrix-js-sdk/src/@types/uia";
|
||||
|
||||
import { MatrixClientPeg } from "../../../../MatrixClientPeg";
|
||||
import { _t } from "../../../../languageHandler";
|
||||
|
@ -79,7 +80,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
|
|||
// no keys which would be a no-op.
|
||||
logger.log("uploadDeviceSigningKeys unexpectedly succeeded without UI auth!");
|
||||
} catch (error) {
|
||||
if (!error.data || !error.data.flows) {
|
||||
if (!(error instanceof MatrixError) || !error.data || !error.data.flows) {
|
||||
logger.log("uploadDeviceSigningKeys advertised no flows!");
|
||||
return;
|
||||
}
|
||||
|
@ -92,7 +93,9 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
|
|||
}
|
||||
}
|
||||
|
||||
private doBootstrapUIAuth = async (makeRequest: (authData: any) => Promise<{}>): Promise<void> => {
|
||||
private doBootstrapUIAuth = async (
|
||||
makeRequest: (authData: AuthDict) => Promise<UIAResponse<void>>,
|
||||
): Promise<void> => {
|
||||
if (this.state.canUploadKeysWithPasswordOnly && this.state.accountPassword) {
|
||||
await makeRequest({
|
||||
type: "m.login.password",
|
||||
|
|
|
@ -55,7 +55,7 @@ interface IState {
|
|||
backupInfo: IKeyBackupInfo | null;
|
||||
backupKeyStored: Record<string, ISecretStorageKeyInfo> | null;
|
||||
loading: boolean;
|
||||
loadError: string | null;
|
||||
loadError: boolean | null;
|
||||
restoreError: {
|
||||
errcode: string;
|
||||
} | null;
|
||||
|
@ -66,7 +66,7 @@ interface IState {
|
|||
passPhrase: string;
|
||||
restoreType: RestoreType | null;
|
||||
progress: {
|
||||
stage: ProgressState;
|
||||
stage: ProgressState | string;
|
||||
total?: number;
|
||||
successes?: number;
|
||||
failures?: number;
|
||||
|
@ -304,7 +304,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
} catch (e) {
|
||||
logger.log("Error loading backup status", e);
|
||||
this.setState({
|
||||
loadError: e,
|
||||
loadError: true,
|
||||
loading: false,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue