I've been handed a project and I'm trying to run the app in Expo, but I'm getting an unhandled promise error.
* utils/index.js:107:28 in * utils/index.js:99:38 in * utils/index.js:91:52 in * utils/index.js:90:38 in getImageInstances* utils/index.js:165:45 in * utils/index.js:163:34 in deleteStaleImages
Inside index.js below:
const getImageInstances = (imagePath, originalImageState) => { const occurrencesList = []; Object.keys(originalImageState).map((reducerKey) => { Object.keys(originalImageState[reducerKey]).map((imageKey) => { const currentImage = originalImageState[reducerKey][imageKey]; if (typeof currentImage === 'string' || typeof currentImage === 'number') { if (imagePath === currentImage) { occurrencesList.push(`${reducerKey}.${imageKey}`); } } else { // If it's not a string, then it's an object Object.keys(currentImage).map((nestedImageKey) => { const nestedImage = currentImage[nestedImageKey]; if (typeof nestedImage === 'string') { if (imagePath === currentImage) { occurrencesList.push(`${reducerKey}.${imageKey}.${nestedImageKey}`); } } else { // If it's not a string, then it's an array nestedImage.map((imageValue, idx) => { if (imagePath === imageValue) { occurrencesList.push(`${reducerKey}.${imageKey}.${nestedImageKey}.${idx}`); } }); } }); } }); });};