enhance(frontend): ファイルのアップロード時に524が返された際のエラーを明示的に表示するように (MisskeyIO#710)

This commit is contained in:
まっちゃてぃー。 2024-08-18 06:00:10 +09:00 committed by GitHub
parent 63f1a8d8ec
commit 8329498d4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 0 deletions

View file

@ -98,6 +98,12 @@ export function uploadFile(
title: i18n.ts.failedToUpload,
text: i18n.ts.cannotUploadBecauseExceedsFileSizeLimit,
});
} else if (xhr.status === 524) {
alert({
type: 'error',
title: i18n.ts.failedToUpload,
text: i18n.ts.cannotUploadBecauseTimeout,
});
} else if (ev.target?.response) {
const res = JSON.parse(ev.target.response);
if (res.error?.id === 'bec5bd69-fba3-43c9-b4fb-2894b66ad5d2') {