mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Use includes instead of elaborate find
Co-authored-by: Bruno Windels <brunow@matrix.org>
This commit is contained in:
parent
a351a185a0
commit
30cb9f6d15
@ -42,7 +42,7 @@ export class HomeServerRequest implements IHomeServerRequest {
|
||||
this._promise = sourceRequest.response().then(response => {
|
||||
log?.set("status", response.status);
|
||||
// ok?
|
||||
if (response.status >= 200 && response.status < 300 || options?.allowedErrors?.find(e => e === response.status)) {
|
||||
if (response.status >= 200 && response.status < 300 || options?.allowedErrors?.includes(response.status)) {
|
||||
log?.finish();
|
||||
return response.body;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user