データ取得のフォールバックを強化
This commit is contained in:
parent
a7d3a34103
commit
d66c2a6ac9
|
@ -91,12 +91,16 @@ async function prepend(data: Misskey.entities.Note | Misskey.entities.StreamNote
|
||||||
credentials: 'omit',
|
credentials: 'omit',
|
||||||
});
|
});
|
||||||
if (!res.ok) return;
|
if (!res.ok) return;
|
||||||
fullNote = (await res.json()) as Misskey.entities.Note;
|
fullNote = (await res.json().catch(() => null)) as Misskey.entities.Note | null;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
// キャッシュできないノート or キャッシュ用のノートが取得できなかった場合
|
||||||
|
if (fullNote == null) {
|
||||||
fullNote = await misskeyApi('notes/show', {
|
fullNote = await misskeyApi('notes/show', {
|
||||||
noteId: data.id,
|
noteId: data.id,
|
||||||
});
|
}).catch(() => null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullNote == null) return;
|
if (fullNote == null) return;
|
||||||
|
|
||||||
note = deepMerge(_data, fullNote);
|
note = deepMerge(_data, fullNote);
|
||||||
|
|
Loading…
Reference in New Issue