diff --git a/src/components/IdealImage/index.js b/src/components/IdealImage/index.js index ef98e9f..6578042 100644 --- a/src/components/IdealImage/index.js +++ b/src/components/IdealImage/index.js @@ -320,8 +320,9 @@ export default class IdealImage extends Component { ...this.state, // eslint-disable-line react/no-access-state-in-setstate size: pickedSrc.size, }) - this.setState({pickedSrc, shouldAutoDownload, url}) - if (shouldAutoDownload) this.load(false) + this.setState({pickedSrc, shouldAutoDownload, url},() => { + if (shouldAutoDownload) this.load(false) + }) } onLeave = () => {