Improve typing (#9474)

This commit is contained in:
Michael Telatynski 2022-10-21 11:44:33 +01:00 committed by GitHub
parent 5f59ce182e
commit fde9a527a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View file

@ -57,8 +57,8 @@ export function messageForResourceLimitError(
}
}
export function messageForSyncError(err: MatrixError): ReactNode {
if (err.errcode === 'M_RESOURCE_LIMIT_EXCEEDED') {
export function messageForSyncError(err: Error): ReactNode {
if (err instanceof MatrixError && err.errcode === 'M_RESOURCE_LIMIT_EXCEEDED') {
const limitError = messageForResourceLimitError(
err.data.limit_type,
err.data.admin_contact,