Conform more of the codebase to strict types (#11191)

This commit is contained in:
Michael Telatynski 2023-07-05 11:53:22 +01:00 committed by GitHub
parent 4044c2aa66
commit 8107f1d271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 88 additions and 57 deletions

View file

@ -15,6 +15,7 @@ limitations under the License.
*/
import React, { createRef, KeyboardEventHandler } from "react";
import { MatrixError } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../languageHandler";
import withValidation, { IFieldState, IValidationResult } from "./Validation";
@ -209,7 +210,7 @@ export default class RoomAliasField extends React.PureComponent<IProps, IState>
// any server error code will do,
// either it M_NOT_FOUND or the alias is invalid somehow,
// in which case we don't want to show the invalid message
return !!err.errcode;
return err instanceof MatrixError;
}
},
valid: () => _t("This address is available to use"),