fix: ドライブアップロードで413が返ってきたときにエラーメッセージを表示 (#10680)

This commit is contained in:
tinaxd 2023-04-22 17:18:57 +09:00 committed by GitHub
parent eb0e2ceef7
commit 5ddffa728a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -83,7 +83,13 @@ export function uploadFile(
// TODO: 消すのではなくて(ネットワーク的なエラーなら)再送できるようにしたい
uploads.value = uploads.value.filter(x => x.id !== id);
if (ev.target?.response) {
if (xhr.status === 413) {
alert({
type: 'error',
title: i18n.ts.failedToUpload,
text: i18n.ts.cannotUploadBecauseExceedsFileSizeLimit,
});
} else if (ev.target?.response) {
const res = JSON.parse(ev.target.response);
if (res.error?.id === 'bec5bd69-fba3-43c9-b4fb-2894b66ad5d2') {
alert({