mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-04 20:02:26 +00:00
Revert "perf(profile): implement stale-while-revalidate for lists and messages"
This commit is contained in:
1 parent
b570350412
commit
27b71ba9bb
4 files changed
+106
-163
No files matched your search
@@ -1407,24 +1407,6 @@ export class ProfileModalController {
|
||||
this.addAccountButtonState = null;
|
||||
this.adminEmptyMessages = new Map();
|
||||
this.hashtagPreferencesUnsubscribe = null;
|
||||
|
||||
if (
|
||||
this.subscriptionsService &&
|
||||
typeof this.subscriptionsService.on === "function"
|
||||
) {
|
||||
this.subscriptionsService.on("change", () => {
|
||||
void this.populateSubscriptionsList();
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
this.services.userBlocks &&
|
||||
typeof this.services.userBlocks.on === "function"
|
||||
) {
|
||||
this.services.userBlocks.on("change", () => {
|
||||
this.populateBlockedList();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async load() {
|
||||
@@ -6783,16 +6765,11 @@ export class ProfileModalController {
|
||||
const shouldStayInMenu = keepMenuView && isMobile;
|
||||
this.setMobileView(shouldStayInMenu ? "menu" : "pane");
|
||||
|
||||
const activeHex = this.normalizeHexPubkey(this.getActivePubkey());
|
||||
|
||||
if (target === "history") {
|
||||
void this.populateProfileWatchHistory();
|
||||
} else if (target === "relays") {
|
||||
this.populateProfileRelays();
|
||||
void this.refreshRelayHealthPanel({
|
||||
forceRefresh: true,
|
||||
reason: "pane-select",
|
||||
});
|
||||
void this.refreshRelayHealthPanel({ forceRefresh: true, reason: "pane-select" });
|
||||
} else if (target === "messages") {
|
||||
this.resumeProfileMessages();
|
||||
void this.populateProfileMessages({ reason: "pane-select" });
|
||||
@@ -6804,14 +6781,8 @@ export class ProfileModalController {
|
||||
} else if (target === "hashtags") {
|
||||
this.populateHashtagPreferences();
|
||||
} else if (target === "subscriptions") {
|
||||
if (activeHex && this.subscriptionsService) {
|
||||
this.subscriptionsService.loadSubscriptions(activeHex).catch(noop);
|
||||
}
|
||||
void this.populateSubscriptionsList();
|
||||
} else if (target === "blocked") {
|
||||
if (activeHex && this.services.userBlocks) {
|
||||
this.services.userBlocks.loadBlocks(activeHex).catch(noop);
|
||||
}
|
||||
this.populateBlockedList();
|
||||
} else if (target === "safety") {
|
||||
this.refreshModerationSettingsUi();
|
||||
@@ -8037,6 +8008,17 @@ export class ProfileModalController {
|
||||
if (Array.isArray(subscriptions) && subscriptions.length) {
|
||||
sourceEntries = subscriptions;
|
||||
} else {
|
||||
if (typeof service.ensureLoaded === "function") {
|
||||
try {
|
||||
await service.ensureLoaded(activeHex);
|
||||
} catch (error) {
|
||||
devLogger.warn(
|
||||
"[profileModal] Failed to ensure subscriptions before populating subscriptions list:",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof service.getSubscribedAuthors === "function") {
|
||||
try {
|
||||
sourceEntries = service.getSubscribedAuthors() || [];
|
||||
@@ -12717,21 +12699,14 @@ export class ProfileModalController {
|
||||
this.setActivePubkey(activePubkey);
|
||||
}
|
||||
|
||||
const walletPromise = this.hydrateActiveWalletSettings(activePubkey);
|
||||
const adminPromise = this.refreshAdminPaneState().catch((error) => {
|
||||
userLogger.warn("Failed to refresh admin pane after login:", error);
|
||||
});
|
||||
await this.hydrateActiveWalletSettings(activePubkey);
|
||||
|
||||
this.renderSavedProfiles();
|
||||
|
||||
// Trigger aggressive parallel fetches
|
||||
if (activePubkey) {
|
||||
if (this.services.userBlocks) {
|
||||
this.services.userBlocks.loadBlocks(activePubkey).catch(noop);
|
||||
}
|
||||
if (this.subscriptionsService) {
|
||||
this.subscriptionsService.loadSubscriptions(activePubkey).catch(noop);
|
||||
}
|
||||
try {
|
||||
await this.refreshAdminPaneState();
|
||||
} catch (error) {
|
||||
userLogger.warn("Failed to refresh admin pane after login:", error);
|
||||
}
|
||||
|
||||
this.populateBlockedList();
|
||||
@@ -12743,10 +12718,8 @@ export class ProfileModalController {
|
||||
this.handleActiveDmIdentityChanged(activePubkey);
|
||||
void this.refreshDmRelayPreferences({ force: true });
|
||||
|
||||
// Ensure critical state is settled if possible, but don't block initial rendering
|
||||
Promise.all([walletPromise, adminPromise, postLoginPromise])
|
||||
postLoginPromise
|
||||
.then(() => {
|
||||
// Re-run population to ensure any late-arriving data is reflected
|
||||
this.populateBlockedList();
|
||||
void this.populateSubscriptionsList();
|
||||
void this.populateFriendsList();
|
||||
|
||||
Reference in new issue
Block a user