Skip to content

Commit 5822ffb

Browse files
authored
Merge pull request #503 from mapswipe/fix_infinte_waiting
catch missing image
2 parents 7655cea + bb221f5 commit 5822ffb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

manager_dashboard/manager_dashboard/create.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ <h3>Basic Project Information</h3>
180180
</li>
181181
<li>
182182
<label for="image">Upload Project Image</label>
183-
<input type="file" accept="..gif,.jpg,.jpeg,.png" id="image" onchange='openImageFile(event)'>
183+
<input type="file" accept=".gif,.jpg,.jpeg,.png" id="image" onchange='openImageFile(event)'>
184184
<span>Make sure you have the rights to use this image. It should end with .jpg or .png.</span>
185185
<p id="imageText"></p>
186186
<img id="imageFile" width="100%">

manager_dashboard/manager_dashboard/js/uploadProjects.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ function uploadProjectImage(mapswipe_import) {
114114

115115
var file = document.getElementById('image').files[0]
116116
console.log(file)
117+
if (file === undefined){
118+
alert("Please upload an image, before retrying to upload the project.")
119+
modalOngoing.style.display = "none";
120+
modal.style.display = "none";
121+
return
122+
}
117123
var filename = file.name
118124
console.log(filename)
119125
// Create a reference to the image

0 commit comments

Comments
 (0)