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 => {
|
this._promise = sourceRequest.response().then(response => {
|
||||||
log?.set("status", response.status);
|
log?.set("status", response.status);
|
||||||
// ok?
|
// 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();
|
log?.finish();
|
||||||
return response.body;
|
return response.body;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user