Refactor chat and market modules for improved integration and maintainability

- Remove deprecated Nostr chat and relay hub components, transitioning to a modular chat service for better encapsulation.
- Update App.vue and Navbar.vue to utilize the new chat module, enhancing user experience with automatic peer management.
- Simplify event handling and connection logic in ChatComponent.vue, ensuring compatibility with the new chat service architecture.
- Adjust market settings and order history components to reflect changes in the chat module, improving overall coherence in the application structure.
- Clean up unused imports and streamline configuration access for better performance and maintainability.
This commit is contained in:
padreug 2025-09-05 01:44:15 +02:00
parent 63de083909
commit 17c07c37a0
17 changed files with 63 additions and 2222 deletions

View file

@ -15,7 +15,7 @@ import { LogoutConfirmDialog } from '@/components/ui/LogoutConfirmDialog'
import { auth } from '@/composables/useAuth'
import { useMarketPreloader } from '@/composables/useMarketPreloader'
import { useMarketStore } from '@/stores/market'
import { nostrChat } from '@/composables/useNostrChat'
import { tryInjectService, SERVICE_TOKENS } from '@/core/di-container'
import { useModularNavigation } from '@/composables/useModularNavigation'
interface NavigationItem {
@ -45,9 +45,12 @@ const totalBalance = computed(() => {
}, 0)
})
// Try to get chat service from DI (may not be available if chat module not loaded)
const chatService = tryInjectService(SERVICE_TOKENS.CHAT_SERVICE)
// Compute total unread messages (reactive)
const totalUnreadMessages = computed(() => {
return nostrChat.totalUnreadCount.value
return chatService?.totalUnreadCount?.value || 0
})
// Compute cart item count