Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +19 -13
templates/index.html
CHANGED
@@ -165,20 +165,26 @@
|
|
165 |
loading.style.display = 'block';
|
166 |
});
|
167 |
|
168 |
-
//
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
loading.style.display = 'none';
|
176 |
-
}
|
177 |
-
|
178 |
-
|
179 |
-
console.error('Error loading feeds:', error);
|
180 |
-
loading.style.display = 'none';
|
181 |
-
});
|
182 |
});
|
183 |
</script>
|
184 |
</body>
|
|
|
165 |
loading.style.display = 'block';
|
166 |
});
|
167 |
|
168 |
+
// Poll until feeds are loaded
|
169 |
+
function checkFeeds() {
|
170 |
+
fetch('/check_feeds')
|
171 |
+
.then(response => response.json())
|
172 |
+
.then(data => {
|
173 |
+
if (data.status === "loaded") {
|
174 |
+
window.location.href = '/index';
|
175 |
+
} else if (data.status === "error") {
|
176 |
+
console.error('Error loading feeds:', data.message);
|
177 |
+
loading.style.display = 'none';
|
178 |
+
} else {
|
179 |
+
setTimeout(checkFeeds, 1000); // Check every second
|
180 |
+
}
|
181 |
+
})
|
182 |
+
.catch(error => {
|
183 |
+
console.error('Error checking feeds:', error);
|
184 |
loading.style.display = 'none';
|
185 |
+
});
|
186 |
+
}
|
187 |
+
checkFeeds();
|
|
|
|
|
|
|
188 |
});
|
189 |
</script>
|
190 |
</body>
|