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 {
322322 }
323323}
324324
325- function fetchWithTimeout ( resource : RequestInfo , options : RequestInit = { } , timeout = 10000 ) : Promise < Response > {
325+ function fetchWithTimeout ( resource : RequestInfo , timeout = 10000 ) : Promise < Response > {
326326 return Promise . race ( [
327- fetch ( resource , options ) ,
327+ this . app . request . requestUrl ( resource ) ,
328328 new Promise < Response > ( ( _ , reject ) => setTimeout ( ( ) => reject ( new Error ( "Request timed out" ) ) , timeout ) )
329329 ] ) ;
330330}
@@ -334,11 +334,10 @@ export async function isOnline(timeout = 3000): Promise<boolean> {
334334 const controller = new AbortController ( ) ;
335335 const id = setTimeout ( ( ) => controller . abort ( ) , timeout ) ;
336336
337- await fetch ( "https://ping.archlinux.org" , {
337+ await this . app . request . requestUrl ( {
338+ url : "https://ping.archlinux.org" ,
338339 method : "GET" ,
339- mode : "no-cors" ,
340- signal : controller . signal ,
341- cache : "no-store"
340+ cache : "no-cache"
342341 } ) ;
343342 clearTimeout ( id ) ;
344343 return true ;
You can’t perform that action at this time.
0 commit comments