From 11edfc4a714d553fa6777e07ad9c3cd9edc9788b Mon Sep 17 00:00:00 2001 From: Ganapathy S Date: Thu, 30 Mar 2023 20:30:53 +0530 Subject: [PATCH] fix: read svg file on android (#2016) PR fixing the behavior for fetching local files in `SvgUri` on `Android`. Co-authored-by: Wojciech Lewicki --- src/xml.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xml.tsx b/src/xml.tsx index cc334d72..ff9b02e0 100644 --- a/src/xml.tsx +++ b/src/xml.tsx @@ -122,7 +122,7 @@ export function SvgXml(props: XmlProps) { export async function fetchText(uri: string) { const response = await fetch(uri); - if (response.ok) { + if (response.ok || (response.status === 0 && uri.startsWith('file://'))) { return await response.text(); } throw new Error(`Fetching ${uri} failed with status ${response.status}`);