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) {
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) {