From cb4a5c0fca5b90f1ee4ba88be74866b1b1967515 Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Wed, 7 Sep 2022 23:25:48 -0400 Subject: [PATCH] Add debug statements --- packages/netlify-cms-widget-file/src/withFileControl.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/netlify-cms-widget-file/src/withFileControl.js b/packages/netlify-cms-widget-file/src/withFileControl.js index 215dcc28..c1f7eb56 100644 --- a/packages/netlify-cms-widget-file/src/withFileControl.js +++ b/packages/netlify-cms-widget-file/src/withFileControl.js @@ -195,6 +195,8 @@ export default function withFileControl({ forImage } = {}) { } shouldComponentUpdate(nextProps) { + console.log('[withFileControl][shouldComponentUpdate] nextProps', nextProps); + /** * Always update if the value or getAsset changes. */ @@ -217,6 +219,8 @@ export default function withFileControl({ forImage } = {}) { componentDidUpdate() { const { mediaPaths, value, onRemoveInsertedMedia, onChange } = this.props; const mediaPath = mediaPaths.get(this.controlID); + console.log('[withFileControl][shouldComponentUpdate] mediaPath', mediaPath); + console.log('[withFileControl][shouldComponentUpdate] value', value); if (mediaPath && mediaPath !== value) { onChange(mediaPath); } else if (mediaPath && mediaPath === value) {