Skip to content

Commit 61af2e0

Browse files
committed
docs(hub-ui): retain icon failure handling rationale
1 parent da36529 commit 61af2e0

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎packages/hub-ui/src/client/components/icons/IconifyIcon.vue‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ watchEffect(async (onCleanup) => {
3636
iconifyLoaded.value = svg
3737
}
3838
catch {
39+
/** Keep fetch failures local to the icon so the surrounding panel remains usable. */
3940
if (active)
4041
failed.value = true
4142
}

‎packages/hub-ui/src/client/utils/iconify.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function getIconifySvg(collection: string, icon: string) {
2424

2525
async function _get() {
2626
const url = `https://api.iconify.design/${collection}/${icon}.svg?color=currentColor&width=100%`
27+
/** Bound stalled requests so the caller can display its failure glyph. */
2728
const response = await fetch(url, { signal: AbortSignal.timeout(10_000) })
2829
if (!response.ok)
2930
throw new Error(`Iconify request failed: ${response.status}`)

0 commit comments

Comments
 (0)