Merge pull request #924 from PR0M3TH3AN/codex/extend-service_contract-with-subscriptions

Validate subscriptions manager injection for profile modal
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-26 14:08:12 -04:00
commit 0fb1c36fe1
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;