Validate subscriptions service for profile modal

This commit is contained in:
thePR0M3TH3AN committed 2025-10-26 14:01:02 -04:00
1 parent 4de73ebb76
commit c9a8b286ea
2 files changed
+15

No files matched your search

+1
View File
@@ -646,6 +646,7 @@ class Application {
relayManager,
userBlocks,
nostrClient,
subscriptions,
accessControl,
getCurrentUserNpub: () => this.getCurrentUserNpub(),
nwcSettings: this.nwcSettingsService,
+14
View File
@@ -275,6 +275,13 @@ const SERVICE_CONTRACT = [
type: "object",
description: "Reference to the nostr client powering subscriptions and profile fetches.",
},
{
key: "subscriptions",
type: "object",
optional: true,
description:
"Subscriptions manager used by the profile modal to inspect or refresh the viewer's channel subscriptions.",
},
{
key: "accessControl",
type: "object",
@@ -852,6 +859,13 @@ export class ProfileModalController {
devLogger.log(...args);
};
const subscriptionsServiceCandidate = this.services.subscriptions;
this.subscriptionsService =
subscriptionsServiceCandidate &&
typeof subscriptionsServiceCandidate === "object"
? subscriptionsServiceCandidate
: null;
this.hashtagPreferencesService = this.services.hashtagPreferences;
this.describeHashtagPreferencesErrorService =
this.services.describeHashtagPreferencesError;