Skip to content

Commit ef5b8fd

Browse files
committedNov 8, 2024
feat: increase default fetchTimeout to 1500
1 parent 13e5e7d commit ef5b8fd

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed
 

‎src/runtime/components/shared.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ export async function loadIcon(name: string, timeout: number): Promise<Required<
2424
})
2525

2626
if (timeout > 0)
27-
await Promise.race([load, new Promise<void>((resolve) => {
28-
timeoutWarn = setTimeout(() => {
29-
consola.warn(`[Icon] loading icon \`${name}\` timed out after ${timeout}ms`)
30-
resolve()
31-
}, timeout)
32-
})])
27+
await Promise.race([
28+
load,
29+
new Promise<void>((resolve) => {
30+
timeoutWarn = setTimeout(() => {
31+
consola.warn(`[Icon] loading icon \`${name}\` timed out after ${timeout}ms`)
32+
resolve()
33+
}, timeout)
34+
})])
3335
.finally(() => clearTimeout(timeoutWarn))
3436
else
3537
await load

‎src/schema-types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export interface NuxtIconRuntimeOptions {
135135
*
136136
* Set the timeout for fetching icons.
137137
*
138-
* @default 500
138+
* @default 1500
139139
*/
140140
fetchTimeout: number
141141

‎src/schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const schema = {
139139
},
140140
},
141141
fetchTimeout: {
142-
$default: 500,
142+
$default: 1500,
143143
$schema: {
144144
title: 'Fetch Timeout',
145145
description: 'Set the timeout for fetching icons.',

0 commit comments

Comments
 (0)
Please sign in to comment.