Skip to content

Commit

Permalink
データ取得のフォールバックを強化
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih committed Dec 29, 2024
1 parent a7d3a34 commit d66c2a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/frontend/src/components/MkTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@ async function prepend(data: Misskey.entities.Note | Misskey.entities.StreamNote
credentials: 'omit',
});
if (!res.ok) return;
fullNote = (await res.json()) as Misskey.entities.Note;
} else {
fullNote = (await res.json().catch(() => null)) as Misskey.entities.Note | null;
}

// キャッシュできないノート or キャッシュ用のノートが取得できなかった場合
if (fullNote == null) {
fullNote = await misskeyApi('notes/show', {
noteId: data.id,
});
}).catch(() => null);
}

if (fullNote == null) return;

note = deepMerge(_data, fullNote);
Expand Down

0 comments on commit d66c2a6

Please sign in to comment.