Skip to content

Commit dc44c9a

Browse files
committed
Fix cape upload errors not showing up
1 parent 1a576cf commit dc44c9a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/routes/account/+page.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
let form = new FormData();
4141
form.append("file", customCape.files![0]);
4242
43+
customCapeError.textContent = "";
44+
4345
api("account/uploadCape", true, "POST", form)
4446
.then(() => refreshUser())
45-
.catch(reason => customCapeError = reason);
47+
.catch(reason => customCapeError.textContent = reason);
4648
}
4749
</script>
4850

@@ -120,7 +122,7 @@
120122
{#if $user.canHavaCustomcape}
121123
<form on:submit|preventDefault={submit}>
122124
<label for="upload-cape" class="form-label"><b>Upload custom cape</b></label>
123-
<input bind:this={customCape} type="file" id="upload-cape" name="upload-cape" required>
125+
<input bind:this={customCape} type="file" accept=".png" id="upload-cape" name="upload-cape" required>
124126

125127
<span bind:this={customCapeError} class="error"></span>
126128

@@ -198,4 +200,9 @@
198200
padding: 0.5rem;
199201
font-size: 1rem;
200202
}
203+
204+
.error {
205+
color: red;
206+
margin-bottom: 1rem;
207+
}
201208
</style>

0 commit comments

Comments
 (0)