Conform more of the codebase to strict types (#11191)
This commit is contained in:
parent
4044c2aa66
commit
8107f1d271
25 changed files with 88 additions and 57 deletions
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue