File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,11 @@ export function drawImageInCanvas(img) {
186186 * see: https://stackoverflow.com/a/9039885
187187 * @returns {boolean } isIOS device
188188 */
189- function isIOS ( ) {
190- return [
189+ export function isIOS ( ) {
190+ if ( isIOS . cachedResult !== undefined ) {
191+ return isIOS . cachedResult ;
192+ }
193+ isIOS . cachedResult = [
191194 'iPad Simulator' ,
192195 'iPhone Simulator' ,
193196 'iPod Simulator' ,
@@ -197,6 +200,7 @@ function isIOS() {
197200 ] . includes ( navigator . platform )
198201 // iPad on iOS 13 detection
199202 || ( navigator . userAgent . includes ( 'Mac' ) && 'ontouchend' in document ) ;
203+ return isIOS . cachedResult ;
200204}
201205
202206/**
@@ -213,6 +217,9 @@ export async function drawFileInCanvas(file) {
213217 }
214218 img = await createImageBitmap ( file ) ;
215219 } catch ( e ) {
220+ if ( process . env . BUILD === 'development' ) {
221+ console . error ( e ) ;
222+ }
216223 const dataUrl = await getDataUrlFromFile ( file ) ;
217224 img = await loadImage ( dataUrl ) ;
218225 }
You can’t perform that action at this time.
0 commit comments