diff --git a/js/app.js b/js/app.js index 61bab537..cfc27378 100644 --- a/js/app.js +++ b/js/app.js @@ -646,6 +646,7 @@ class Application { relayManager, userBlocks, nostrClient, + subscriptions, accessControl, getCurrentUserNpub: () => this.getCurrentUserNpub(), nwcSettings: this.nwcSettingsService, diff --git a/js/ui/profileModalController.js b/js/ui/profileModalController.js index 079f5817..0fc8345f 100644 --- a/js/ui/profileModalController.js +++ b/js/ui/profileModalController.js @@ -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;