Make more of the codebase conform to strict types (#10857)

This commit is contained in:
Michael Telatynski 2023-05-16 14:25:43 +01:00 committed by GitHub
parent 7f017a84c2
commit 6a3f59cc76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 127 additions and 121 deletions

View file

@ -16,7 +16,7 @@ limitations under the License.
import React from "react";
import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types";
import { createClient, MatrixClient } from "matrix-js-sdk/src/matrix";
import { createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixClientPeg } from "./MatrixClientPeg";
@ -123,7 +123,7 @@ export default class IdentityAuthClient {
try {
await this.matrixClient.getIdentityAccount(token);
} catch (e) {
if (e.errcode === "M_TERMS_NOT_SIGNED") {
if (e instanceof MatrixError && e.errcode === "M_TERMS_NOT_SIGNED") {
logger.log("Identity server requires new terms to be agreed to");
await startTermsFlow([new Service(SERVICE_TYPES.IS, identityServerUrl, token)]);
return;