1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-27 22:38:39 +09:00

fix: アップロードエラー時の処理を修正 (#8182)

* アップロードのエラー応答で詰むのを修正

* CHANGELOG
This commit is contained in:
MeiMei 2022-01-24 02:18:27 +09:00 committed by GitHub
parent 7aecf15f94
commit fa554f1684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@
- Unifying Misskey-specific IRIs in JSON-LD `@context` - Unifying Misskey-specific IRIs in JSON-LD `@context`
### Bugfixes ### Bugfixes
- アップロードエラー時の処理を修正
## 12.101.1 (2021/12/29) ## 12.101.1 (2021/12/29)

View File

@ -570,7 +570,7 @@ export function upload(file: File, folder?: any, name?: string): Promise<Misskey
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true); xhr.open('POST', apiUrl + '/drive/files/create', true);
xhr.onload = (ev) => { xhr.onload = (ev) => {
if (ev.target == null || ev.target.response == null) { if (xhr.status !== 200 || ev.target == null || ev.target.response == null) {
// TODO: 消すのではなくて再送できるようにしたい // TODO: 消すのではなくて再送できるようにしたい
uploads.value = uploads.value.filter(x => x.id != id); uploads.value = uploads.value.filter(x => x.id != id);