Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Update types to match js-sdk --strict mode (#9528)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Weimann <[email protected]>
  • Loading branch information
t3chguy and weeman1337 authored Nov 3, 2022
1 parent 3330d5a commit 5f540eb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/structures/InteractiveAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface IProps {
continueText?: string;
continueKind?: string;
// callback
makeRequest(auth: IAuthData): Promise<IAuthData>;
makeRequest(auth: IAuthData | null): Promise<IAuthData>;
// callback called when the auth process has finished,
// successfully or unsuccessfully.
// @param {boolean} status True if the operation requiring
Expand Down Expand Up @@ -199,7 +199,7 @@ export default class InteractiveAuthComponent extends React.Component<IProps, IS
});
};

private requestCallback = (auth: IAuthData, background: boolean): Promise<IAuthData> => {
private requestCallback = (auth: IAuthData | null, background: boolean): Promise<IAuthData> => {
// This wrapper just exists because the js-sdk passes a second
// 'busy' param for backwards compat. This throws the tests off
// so discard it here.
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/auth/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { AuthType, createClient } from 'matrix-js-sdk/src/matrix';
import { AuthType, createClient, IAuthData } from 'matrix-js-sdk/src/matrix';
import React, { Fragment, ReactNode } from 'react';
import { MatrixClient } from "matrix-js-sdk/src/client";
import classNames from "classnames";
Expand Down Expand Up @@ -443,7 +443,7 @@ export default class Registration extends React.Component<IProps, IState> {
});
};

private makeRegisterRequest = auth => {
private makeRegisterRequest = (auth: IAuthData | null) => {
const registerParams = {
username: this.state.formVals.username,
password: this.state.formVals.password,
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/DeactivateAccountDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
this.setState({ errStr: _t("There was a problem communicating with the server. Please try again.") });
};

private onUIAuthComplete = (auth: IAuthData): void => {
private onUIAuthComplete = (auth: IAuthData | null): void => {
// XXX: this should be returning a promise to maintain the state inside the state machine correct
// but given that a deactivation is followed by a local logout and all object instances being thrown away
// this isn't done.
Expand Down
2 changes: 1 addition & 1 deletion test/toasts/IncomingLegacyCallToast-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('<IncomingLegacyCallToast />', () => {
const mockRoom = new Room('!room:server.org', mockClient, userId);
mockClient.deviceId = deviceId;

const call = new MatrixCall({ client: mockClient });
const call = new MatrixCall({ client: mockClient, roomId: mockRoom.roomId });
const defaultProps = {
call,
};
Expand Down

0 comments on commit 5f540eb

Please sign in to comment.