Fix profile watch history and subscription lists syncing issues.

This commit is contained in:
google-labs-jules[bot] committed 2026-01-07 18:44:43 +00:00
1 parent 8cb3da3129
commit 9d365bf65e
3 files changed
+33 -3

No files matched your search

+15 -3
View File
@@ -224,6 +224,7 @@ class SubscriptionsManager {
constructor() {
this.subscribedPubkeys = new Set();
this.subsEventId = null;
this.currentUserPubkey = null;
this.loaded = false;
this.loadingPromise = null;
this.subscriptionListView = null;
@@ -379,19 +380,30 @@ class SubscriptionsManager {
const normalized = parseSubscriptionPlaintext(decryptedStr);
this.subscribedPubkeys = new Set(normalized);
this.currentUserPubkey = normalizedUserPubkey;
this.loaded = true;
} catch (err) {
userLogger.error("[SubscriptionsManager] Failed to load subs:", err);
}
}
reset() {
this.subscribedPubkeys.clear();
this.subsEventId = null;
this.currentUserPubkey = null;
this.loaded = false;
this.lastRunOptions = null;
this.lastResult = null;
this.hasRenderedOnce = false;
}
async ensureLoaded(actorHex) {
if (this.loaded) {
const normalizedActor = normalizeHexPubkey(actorHex) || actorHex;
if (!normalizedActor) {
return;
}
const normalizedActor = normalizeHexPubkey(actorHex) || actorHex;
if (!normalizedActor) {
if (this.loaded && this.currentUserPubkey === normalizedActor) {
return;
}