if it aint empty, excute the function

This commit is contained in:
Justin 2023-08-02 21:32:00 +08:00 committed by GitHub
parent f23c03c69d
commit caf38275ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3349,10 +3349,10 @@ function scanNetworks() {
}
// UPLOAD CUSTOM STOCK LOGO
function uploadStockLogo() {
const fileInput_stocks = document.getElementById("stocks-logo-upload-browse");
if (fileInput_stocks.value !== "") {
const stock_file = fileInput_stocks.files[0];
const stock_upload_msg = document.getElementById("stocklogoupload");
@ -3368,11 +3368,12 @@ function uploadStockLogo() {
}, 5000);
fileInput_stocks.value = "";
}
}
// UPLOAD CUSTOM CRYPTO LOGO
function uploadCryptoLogo() {
const fileInput_crypto = document.getElementById("crypto-logo-upload-browse");
if (fileInput_crypto.value !== "") {
const crypto_file = fileInput_crypto.files[0];
const crypto_upload_msg = document.getElementById("cryptologoupload");
@ -3381,11 +3382,12 @@ function uploadCryptoLogo() {
fetch('/upload_crypto', {
method: 'POST',
body: formData_crypto
})
});
crypto_upload_msg.style.display = "block";
setTimeout(function hideElement() {
crypto_upload_msg.style.display = "none";
}, 5000);
fileInput_crypto.value = "";
}
}