notify user about wrong skin/cape format
This commit is contained in:
parent
f393496a1b
commit
020a2ae815
|
@ -10,12 +10,14 @@ const uploadSkin = async (event) => {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append("file", skinFile);
|
formData.append("file", skinFile);
|
||||||
|
|
||||||
await fetch(`/api/uploadSkin`, {
|
const response = await fetch(`/api/uploadSkin`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
|
|
||||||
window.location = window.location.href+'?eraseCache=true';
|
if (response.status != 200) {
|
||||||
|
alert(await response.text())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploadCape = async (event) => {
|
const uploadCape = async (event) => {
|
||||||
|
@ -30,15 +32,16 @@ const uploadCape = async (event) => {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append("file", capeFile);
|
formData.append("file", capeFile);
|
||||||
|
|
||||||
await fetch(`/api/uploadCape`, {
|
const response = await fetch(`/api/uploadCape`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
|
|
||||||
window.location = window.location.href+'?eraseCache=true';
|
if (response.status != 200) {
|
||||||
|
alert(await response.text())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.onload = async function() {
|
window.onload = async function() {
|
||||||
document.getElementById("skinForm").addEventListener("submit", uploadSkin)
|
document.getElementById("skinForm").addEventListener("submit", uploadSkin)
|
||||||
if (document.getElementById("cape")) {
|
if (document.getElementById("cape")) {
|
||||||
|
|
Loading…
Reference in New Issue