fix: Display network error on API fetch failure

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
Tanner
2025-11-21 00:49:14 +00:00
parent a9b688309c
commit c09ffecdd9
+6 -1
View File
@@ -10,7 +10,12 @@ function Feed({ updateCache }) {
useEffect(() => {
fetch('/api')
.then(res => res.json())
.then(res => {
if (!res.ok) {
throw new Error(`Server responded with ${res.status} ${res.statusText}`);
}
return res.json();
})
.then(
async (result) => {
const newApiStories = result.stories;