Skip to content

Commit a831aee

Browse files
authored
Merge pull request #35 from anaganisk/patch-1
fixes window.cordova.require not a function on capacitor.
2 parents 01e491b + 9bc17bf commit a831aee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// add support for cordova-plugin-file
2-
const moduleMapper = typeof window !== 'undefined' && window.cordova && window.cordova.require('cordova/modulemapper');
2+
const moduleMapper = typeof window !== 'undefined' && window.cordova && window.cordova.require && window.cordova.require('cordova/modulemapper');
33
export const CustomFile = (moduleMapper && moduleMapper.getOriginalSymbol(window, 'File')) || File;
44
export const CustomFileReader = (moduleMapper && moduleMapper.getOriginalSymbol(window, 'FileReader')) || FileReader;
55
/**
@@ -277,4 +277,4 @@ export function cleanupMemory(canvas) {
277277
canvas.width = 0;
278278
canvas.height = 0;
279279
canvas = null;
280-
}
280+
}

0 commit comments

Comments
 (0)