@@ -19,7 +19,7 @@ import { createClient } from "matrix-js-sdk/src/matrix";
1919import { InvalidStoreError } from "matrix-js-sdk/src/errors" ;
2020import { RoomMember } from "matrix-js-sdk/src/models/room-member" ;
2121import { MatrixEvent } from "matrix-js-sdk/src/models/event" ;
22- import { sleep , defer , IDeferred } from "matrix-js-sdk/src/utils" ;
22+ import { sleep , defer , IDeferred , QueryDict } from "matrix-js-sdk/src/utils" ;
2323
2424// focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by _AccessibleButton.scss
2525import 'focus-visible' ;
@@ -155,7 +155,7 @@ const ONBOARDING_FLOW_STARTERS = [
155155
156156interface IScreen {
157157 screen : string ;
158- params ?: object ;
158+ params ?: QueryDict ;
159159}
160160
161161/* eslint-disable camelcase */
@@ -185,17 +185,17 @@ interface IProps { // TODO type things better
185185 onNewScreen : ( screen : string , replaceLast : boolean ) => void ;
186186 enableGuest ?: boolean ;
187187 // the queryParams extracted from the [real] query-string of the URI
188- realQueryParams ?: Record < string , string > ;
188+ realQueryParams ?: QueryDict ;
189189 // the initial queryParams extracted from the hash-fragment of the URI
190- startingFragmentQueryParams ?: Record < string , string > ;
190+ startingFragmentQueryParams ?: QueryDict ;
191191 // called when we have completed a token login
192192 onTokenLoginCompleted ?: ( ) => void ;
193193 // Represents the screen to display as a result of parsing the initial window.location
194194 initialScreenAfterLogin ?: IScreen ;
195195 // displayname, if any, to set on the device when logging in/registering.
196196 defaultDeviceDisplayName ?: string ;
197197 // A function that makes a registration URL
198- makeRegistrationUrl : ( object ) => string;
198+ makeRegistrationUrl : ( params : QueryDict ) => string ;
199199}
200200
201201interface IState {
@@ -298,7 +298,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
298298 if ( this . screenAfterLogin . screen . startsWith ( "room/" ) && params [ 'signurl' ] && params [ 'email' ] ) {
299299 // probably a threepid invite - try to store it
300300 const roomId = this . screenAfterLogin . screen . substring ( "room/" . length ) ;
301- ThreepidInviteStore . instance . storeInvite ( roomId , params as IThreepidInviteWireFormat ) ;
301+ ThreepidInviteStore . instance . storeInvite ( roomId , params as unknown as IThreepidInviteWireFormat ) ;
302302 }
303303 }
304304
@@ -1952,7 +1952,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
19521952 this . setState ( { serverConfig } ) ;
19531953 } ;
19541954
1955- private makeRegistrationUrl = ( params : { [ key : string ] : string } ) => {
1955+ private makeRegistrationUrl = ( params : QueryDict ) => {
19561956 if ( this . props . startingFragmentQueryParams . referrer ) {
19571957 params . referrer = this . props . startingFragmentQueryParams . referrer ;
19581958 }
@@ -2107,7 +2107,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
21072107 onForgotPasswordClick = { showPasswordReset ? this . onForgotPasswordClick : undefined }
21082108 onServerConfigChange = { this . onServerConfigChange }
21092109 fragmentAfterLogin = { fragmentAfterLogin }
2110- defaultUsername = { this . props . startingFragmentQueryParams . defaultUsername }
2110+ defaultUsername = { this . props . startingFragmentQueryParams . defaultUsername as string }
21112111 { ...this . getServerProperties ( ) }
21122112 />
21132113 ) ;
0 commit comments