Add debug statements

This commit is contained in:
Daniel Lautzenheiser 2022-09-07 23:25:48 -04:00
parent 52fed59c95
commit cb4a5c0fca

View File

@ -195,6 +195,8 @@ export default function withFileControl({ forImage } = {}) {
} }
shouldComponentUpdate(nextProps) { shouldComponentUpdate(nextProps) {
console.log('[withFileControl][shouldComponentUpdate] nextProps', nextProps);
/** /**
* Always update if the value or getAsset changes. * Always update if the value or getAsset changes.
*/ */
@ -217,6 +219,8 @@ export default function withFileControl({ forImage } = {}) {
componentDidUpdate() { componentDidUpdate() {
const { mediaPaths, value, onRemoveInsertedMedia, onChange } = this.props; const { mediaPaths, value, onRemoveInsertedMedia, onChange } = this.props;
const mediaPath = mediaPaths.get(this.controlID); const mediaPath = mediaPaths.get(this.controlID);
console.log('[withFileControl][shouldComponentUpdate] mediaPath', mediaPath);
console.log('[withFileControl][shouldComponentUpdate] value', value);
if (mediaPath && mediaPath !== value) { if (mediaPath && mediaPath !== value) {
onChange(mediaPath); onChange(mediaPath);
} else if (mediaPath && mediaPath === value) { } else if (mediaPath && mediaPath === value) {