[frontend/components] Catch and display a notice for IOException in compose

This commit is contained in:
pancakes 2025-03-21 23:34:27 +10:00
parent dcc6fd3a19
commit d84979bd10
No known key found for this signature in database

View file

@ -472,8 +472,15 @@
private async Task Upload(InputFileChangeEventArgs e)
{
UploadingFiles += 1;
try
{
var res = await ApiService.Drive.UploadFileAsync(e.File);
Attachments.Add(res);
}
catch (IOException exception)
{
await GlobalComponentSvc.NoticeDialog?.Display(exception.Message, NoticeDialog.NoticeType.Error)!;
}
UploadingFiles -= 1;
}