mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 01:42:27 +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
@@ -2409,6 +2409,10 @@ export function createWatchHistoryRenderer(config = {}) {
|
||||
await this.init(options);
|
||||
return;
|
||||
}
|
||||
if (options.actor !== state.actor) {
|
||||
await this.refresh(options);
|
||||
return;
|
||||
}
|
||||
refreshElements();
|
||||
updateFeatureBanner();
|
||||
if (!state.featureEnabled) {
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
|
||||
@@ -8828,6 +8828,20 @@ export class ProfileModalController {
|
||||
userLogger.warn("Failed to refresh admin pane after logout:", error);
|
||||
}
|
||||
|
||||
if (
|
||||
this.subscriptionsService &&
|
||||
typeof this.subscriptionsService.reset === "function"
|
||||
) {
|
||||
try {
|
||||
this.subscriptionsService.reset();
|
||||
} catch (error) {
|
||||
devLogger.warn(
|
||||
"[profileModal] Failed to reset subscriptions service on logout:",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.populateBlockedList();
|
||||
this.clearSubscriptionsList();
|
||||
this.clearFriendsList();
|
||||
|
||||
Reference in new issue
Block a user