mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-07 21:32:51 +00:00
Fix profile watch history and subscription lists syncing issues.
This commit is contained in:
1 parent
8cb3da3129
commit
9d365bf65e
3 files changed
+33
-3
No files matched your search
+15
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user