File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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
198200 padding : 0.5rem ;
199201 font-size : 1rem ;
200202 }
203+
204+ .error {
205+ color : red ;
206+ margin-bottom : 1rem ;
207+ }
201208 </style >
You can’t perform that action at this time.
0 commit comments