From 45391cbaa1b012f13a5b58183006eee7de007710 Mon Sep 17 00:00:00 2001 From: padreug Date: Wed, 17 Sep 2025 01:11:53 +0200 Subject: [PATCH] Add ProfileService and integrate profiles management into NostrFeed module - Introduced ProfileService to handle user profiles, including fetching and displaying profile information. - Updated NostrFeed module to register ProfileService in the DI container and initialize it during installation. - Enhanced NostrFeed.vue to utilize the profiles service for displaying user names alongside posts. - Created useProfiles composable for managing profile-related functionality, including fetching and subscribing to profile updates. These changes improve user engagement by providing richer profile information within the feed, enhancing the overall user experience. --- src/core/di-container.ts | 1 + .../nostr-feed/components/NostrFeed.vue | 92 +++--- .../nostr-feed/composables/useProfiles.ts | 90 ++++++ src/modules/nostr-feed/index.ts | 30 +- .../nostr-feed/services/ProfileService.ts | 275 ++++++++++++++++++ src/pages/Home.vue | 2 +- 6 files changed, 443 insertions(+), 47 deletions(-) create mode 100644 src/modules/nostr-feed/composables/useProfiles.ts create mode 100644 src/modules/nostr-feed/services/ProfileService.ts diff --git a/src/core/di-container.ts b/src/core/di-container.ts index 0b3d93a..72c4926 100644 --- a/src/core/di-container.ts +++ b/src/core/di-container.ts @@ -134,6 +134,7 @@ export const SERVICE_TOKENS = { // Feed services FEED_SERVICE: Symbol('feedService'), + PROFILE_SERVICE: Symbol('profileService'), // Events services EVENTS_SERVICE: Symbol('eventsService'), diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue index d254547..211cf74 100644 --- a/src/modules/nostr-feed/components/NostrFeed.vue +++ b/src/modules/nostr-feed/components/NostrFeed.vue @@ -1,10 +1,11 @@