Skip to content

Commit

Permalink
fix: update the image wrong reload after update
Browse files Browse the repository at this point in the history
  • Loading branch information
berviantoleo authored Nov 27, 2020
1 parent 0af5df6 commit 15bfd3e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class ReactMultiCrop extends Component {
}

changeImage() {
const { canvas } = this.state;
if (canvas.backgroundImage) {
return;
}
const { record, image } = this.props
let setImage = this.loadImage.bind(this)
if (typeof record === 'object' && record.image) {
Expand All @@ -61,7 +65,7 @@ class ReactMultiCrop extends Component {
initialImage() {
const { record, image } = this.props
let loadImageNow = this.loadImage.bind(this)
if (typeof record === 'object') {
if (typeof record === 'object' && record.image) {
fabric.Image.fromURL(record.image, loadImageNow)
} else if (typeof image === 'string') {
fabric.Image.fromURL(image, loadImageNow)
Expand Down

0 comments on commit 15bfd3e

Please sign in to comment.