Skip to content

Commit

Permalink
fix(native): prefer local uri for fs
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett committed Sep 4, 2023
1 parent c228a2a commit 99ba83f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/fiber/src/native/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ export function polyfills() {
let uri = asset.localUri || asset.uri

// Make FS paths web-safe
if (asset.uri.startsWith('file://')) {
const data = await fs.readAsStringAsync(asset.uri, { encoding: fs.EncodingType.Base64 })
if (uri.startsWith('file://')) {
const data = await fs.readAsStringAsync(uri, { encoding: fs.EncodingType.Base64 })
uri = `data:application/octet-stream;base64,${data}`
}

Expand Down

0 comments on commit 99ba83f

Please sign in to comment.