Skip to content

Commit

Permalink
Image upload format issue fixed (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajpootjyoti700 authored Feb 5, 2024
1 parent 894704b commit a3ae029
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ <h3>Upload your Edible to continue....</h3>
</div>
<div id="snackbar"></div>
<button id="upload-btn">Play!</button>
<h5>(Make sure that your image has a transparent background)</h5>
<h5>(Make sure that your image has a transparent background So upload only png files)</h5>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const fileInput = document.querySelector(".file-input");
const progressArea = document.querySelector(".progress-area");
const uploadedArea = document.querySelector(".uploaded-area");

const allowed_EXT = /\.(jpg|jpeg|png)$/i;
const allowed_EXT = /\.(png)$/i;

const files_name_upload = [];

Expand Down Expand Up @@ -247,7 +247,7 @@ fileInput.onchange = ({ target }) => {
let file = target.files;
if (file.length === 1) {
if (!allowed_EXT.exec(file[0].name)) {
showToast("Only Image files are allowed", "#fff");
showToast("Only png files are allowed", "#fff");
} else {
if (!files_name_upload.includes(file[0].name)) {
files_name_upload.push(file[0].name);
Expand Down

0 comments on commit a3ae029

Please sign in to comment.