broadfield-dev commited on
Commit
d5b0deb
·
verified ·
1 Parent(s): 9c8d2a3

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +5 -2
templates/index.html CHANGED
@@ -202,8 +202,11 @@
202
  // Poll until new feeds are loaded
203
  if ("{{ loading_new_feeds }}" === "True") {
204
  function checkNewFeeds() {
205
- fetch('/check_feeds')
206
- .then(response => response.json())
 
 
 
207
  .then(data => {
208
  if (data.status === "loaded") {
209
  location.reload(); // Refresh to show new articles
 
202
  // Poll until new feeds are loaded
203
  if ("{{ loading_new_feeds }}" === "True") {
204
  function checkNewFeeds() {
205
+ fetch('/check_feeds', { timeout: 5000 }) // Add timeout to prevent hang
206
+ .then(response => {
207
+ if (!response.ok) throw new Error('Network response was not ok');
208
+ return response.json();
209
+ })
210
  .then(data => {
211
  if (data.status === "loaded") {
212
  location.reload(); // Refresh to show new articles