mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 22:02:54 +00:00
Fix subscription feed hydration and infinite loading state
This commit is contained in:
1 parent
19cafc9f1a
commit
b07332395b
3 files changed
+158
-1
No files matched your search
+13
-1
@@ -420,7 +420,19 @@ class SubscriptionsManager {
|
||||
this.loadingPromise = loader;
|
||||
|
||||
try {
|
||||
await loader;
|
||||
// Race against a timeout so the UI doesn't hang indefinitely if relays stall.
|
||||
const timeoutMs = 6000;
|
||||
await Promise.race([
|
||||
loader,
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(
|
||||
() => reject(new Error("Timeout loading subscriptions")),
|
||||
timeoutMs
|
||||
)
|
||||
),
|
||||
]);
|
||||
} catch (error) {
|
||||
userLogger.warn("[SubscriptionsManager] ensureLoaded timed out or failed:", error);
|
||||
} finally {
|
||||
this.loadingPromise = null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user