This repository was archived by the owner on Jun 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -322,9 +322,9 @@ class CssSnippetStoreModal extends Modal {
322
322
}
323
323
}
324
324
325
- function fetchWithTimeout ( resource : RequestInfo , options : RequestInit = { } , timeout = 10000 ) : Promise < Response > {
325
+ function fetchWithTimeout ( resource : RequestInfo , timeout = 10000 ) : Promise < Response > {
326
326
return Promise . race ( [
327
- fetch ( resource , options ) ,
327
+ this . app . request . requestUrl ( resource ) ,
328
328
new Promise < Response > ( ( _ , reject ) => setTimeout ( ( ) => reject ( new Error ( "Request timed out" ) ) , timeout ) )
329
329
] ) ;
330
330
}
@@ -334,11 +334,10 @@ export async function isOnline(timeout = 3000): Promise<boolean> {
334
334
const controller = new AbortController ( ) ;
335
335
const id = setTimeout ( ( ) => controller . abort ( ) , timeout ) ;
336
336
337
- await fetch ( "https://ping.archlinux.org" , {
337
+ await this . app . request . requestUrl ( {
338
+ url : "https://ping.archlinux.org" ,
338
339
method : "GET" ,
339
- mode : "no-cors" ,
340
- signal : controller . signal ,
341
- cache : "no-store"
340
+ cache : "no-cache"
342
341
} ) ;
343
342
clearTimeout ( id ) ;
344
343
return true ;
You can’t perform that action at this time.
0 commit comments