Convert /src/async-components/views/dialogs/security to TS (#6923)

* Convert RecoveryMethodRemovedDialog to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Convert NewRecoveryMethodDialog to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Convert ImportE2eKeysDialog to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Convert ExportE2eKeysDialog to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Convert CreateSecretStorageDialog to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Convert CreateKeyBackupDialog to TS

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Fix types

This is somewhat hacky though I don't know of a better way to do this

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-10-23 05:32:16 +02:00 committed by GitHub
parent 39e98b9d7f
commit c5bd1fb32d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 535 additions and 505 deletions

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React, { createRef } from 'react';
import React, { ComponentType, createRef } from 'react';
import { createClient } from "matrix-js-sdk/src/matrix";
import { InvalidStoreError } from "matrix-js-sdk/src/errors";
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
@ -1601,12 +1601,16 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
if (haveNewVersion) {
Modal.createTrackedDialogAsync('New Recovery Method', 'New Recovery Method',
import('../../async-components/views/dialogs/security/NewRecoveryMethodDialog'),
import(
'../../async-components/views/dialogs/security/NewRecoveryMethodDialog'
) as unknown as Promise<ComponentType<{}>>,
{ newVersionInfo },
);
} else {
Modal.createTrackedDialogAsync('Recovery Method Removed', 'Recovery Method Removed',
import('../../async-components/views/dialogs/security/RecoveryMethodRemovedDialog'),
import(
'../../async-components/views/dialogs/security/RecoveryMethodRemovedDialog'
) as unknown as Promise<ComponentType<{}>>,
);
}
});