mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 10:22:25 +00:00
Prioritize user lists syncing during login
Prioritize fetching of block lists, subscriptions, and other user data before loading the main video feed during login. - In `handleAuthLogin`, stop the existing video feed subscription immediately to free up bandwidth. - Explicitly await `subscriptions.ensureLoaded(activePubkey)` alongside `userBlocks.seedWithNpubs` before triggering `refreshAllVideoGrids`. This ensures user context is fully loaded before the heavy feed sync starts, addressing slow sync issues especially with NIP-07. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
358e077ec7
commit
5ae693acbd
1 file changed
+18
@@ -4097,6 +4097,15 @@ class Application {
|
||||
this.resetViewLoggingState();
|
||||
}
|
||||
|
||||
// Stop existing feed subscription to prioritize user data sync
|
||||
if (
|
||||
this.videoSubscription &&
|
||||
typeof this.videoSubscription.unsub === "function"
|
||||
) {
|
||||
this.videoSubscription.unsub();
|
||||
this.videoSubscription = null;
|
||||
}
|
||||
|
||||
this.applyAuthenticatedUiState();
|
||||
this.commentController?.refreshAuthState?.();
|
||||
this.updateShareNostrAuthState({ reason: "auth-login" });
|
||||
@@ -4279,6 +4288,15 @@ class Application {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await subscriptions.ensureLoaded(activePubkey);
|
||||
} catch (error) {
|
||||
devLogger.warn(
|
||||
"[Application] Failed to load subscriptions during login:",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user