Fix null reference error when image upload dialog is closed when image upload finishes

This commit is contained in:
Mitchell McCaffrey 2020-11-26 16:32:48 +11:00
parent aaa793ad71
commit 7ac555baa0
2 changed files with 6 additions and 2 deletions

View File

@ -95,8 +95,10 @@ function SelectMapModal({
await handleImageUpload(file);
}
// Set file input to null to allow adding the same image 2 times in a row
if (fileInputRef.current) {
fileInputRef.current.value = null;
}
}
async function handleImageUpload(file) {
if (!file) {

View File

@ -74,8 +74,10 @@ function SelectTokensModal({ isOpen, onRequestClose }) {
await handleImageUpload(file);
}
// Set file input to null to allow adding the same image 2 times in a row
if (fileInputRef.current) {
fileInputRef.current.value = null;
}
}
async function handleImageUpload(file) {
let name = "Unknown Map";