File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,11 +16,9 @@ export interface MastoHttpConfigProps {
1616 readonly accessToken ?: string ;
1717
1818 /**
19- * Timeout configuration
19+ * Timeout milliseconds for the fetch request.
2020 *
21- * - A number sets the timeout in milliseconds.
22- *
23- * Defaults to 1000 * 300 = 300 seconds.
21+ * Defaults to browser's default timeout.
2422 */
2523 readonly timeout ?: number ;
2624
@@ -95,6 +93,6 @@ export class HttpConfigImpl implements HttpConfig {
9593 signals . push ( signal ) ;
9694 }
9795
98- return mergeAbortSignals ( signals ) ;
96+ return signals . length === 1 ? signals [ 0 ] : mergeAbortSignals ( signals ) ;
9997 }
10098}
Original file line number Diff line number Diff line change @@ -115,8 +115,9 @@ export class HttpNativeImpl extends BaseHttp implements Http {
115115 ) ;
116116 }
117117
118+ // TODO: Remove this handling when `AbortSignal.any` is shipped
118119 // eslint-disable-next-line @typescript-eslint/no-explicit-any
119- if ( error != undefined && ( error as any ) . name === "AbortError " ) {
120+ if ( error != undefined && ( error as any ) . name === "TimeoutError " ) {
120121 return new MastoTimeoutError ( `Request timed out` , { cause : error } ) ;
121122 }
122123
You can’t perform that action at this time.
0 commit comments