fix: read svg file on android (#2016)

PR fixing the behavior for fetching local files in `SvgUri` on `Android`.

Co-authored-by: Wojciech Lewicki <wojciech.lewicki@swmansion.com>
This commit is contained in:
Ganapathy S
2023-03-30 20:30:53 +05:30
committed by GitHub
parent 29382d927a
commit 11edfc4a71
+1 -1
View File
@@ -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}`);