Skip to content

Commit

Permalink
Update Dropzone.vue
Browse files Browse the repository at this point in the history
checksum is the best solution,but us a different tail number is more simple, if Math.random() may return a repeat number, we can also use new Date() and its getTime() function instead of Math.random(), because all times a different, so this can avoid the same number repeat.

I renew my pull request above.
  • Loading branch information
NoZTurn committed Jun 16, 2021
1 parent c137cd1 commit ff60b03
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@
const imageElement = document.querySelector(
DropzoneMap.savedImage(newImage.image_id),
);
imageElement.src = newImage.image_url + '?' + Math.random();
var imageUpdateTime = new Date();
imageElement.src = newImage.image_url + '?' + imageUpdateTime.getTime();
$.growl({message: this.$t('window.imageReplaced')});
this.buttonLoading = false;
Expand Down

0 comments on commit ff60b03

Please sign in to comment.