mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add error feedback for avatar upload
This commit is contained in:
1 file changed
+4
@@ -52,6 +52,7 @@ export default new NamedPage('home_account', () => {
|
||||
}
|
||||
});
|
||||
$confirm.on('click', async () => {
|
||||
try {
|
||||
if ($type.val() === 'upload') {
|
||||
const formData = new FormData();
|
||||
formData.append('file', $file[0].files[0]);
|
||||
@@ -65,5 +66,8 @@ export default new NamedPage('home_account', () => {
|
||||
}
|
||||
await delay(800);
|
||||
window.location.reload();
|
||||
} catch (e) {
|
||||
Notification.error(e.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user