Skip to content

Commit cf9079d

Browse files
jakmroJakub Mroz
andauthored
fix: handle local files (#150)
## Description fix: handle local files ### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update (improves or adds clarity to existing documentation) ### Tested on - [x] iOS - [x] Android ### Checklist - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have updated the documentation accordingly - [x] My changes generate no new warnings Co-authored-by: Jakub Mroz <jakubmroz@Jakubs-MacBook-Pro.local>
1 parent 2e45a30 commit cf9079d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/utils/fetchResource.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ export const fetchResource = async (
3838
) => {
3939
const uri =
4040
typeof source === 'number' ? Asset.fromModule(source).uri : source;
41+
42+
// Handle local files
43+
if (uri.startsWith('file://')) {
44+
return uri;
45+
}
46+
4147
const filename = getFilenameFromUri(uri);
4248
const fileUri = `${RNEDirectory}${filename}`;
4349

0 commit comments

Comments
 (0)