Refactor imports and remove legacy composables for improved code clarity
- Simplify imports in app.ts by removing unused SERVICE_TOKENS. - Eliminate the NavigationItem interface in Navbar.vue as its functionality is now managed by useModularNavigation. - Introduce new legacy composable stubs for useNostrChat and useRelayHub, indicating a shift towards modular chat and relay services. - Update MyTicketsPage.vue to correct the import path for useUserTickets, enhancing module organization. - Refactor ChatService to improve type handling for event tags, ensuring better type safety. Remove ChatComponent, useNostrChat composable, and ChatPage for a modular chat architecture - Delete ChatComponent.vue to streamline chat functionality. - Remove legacy useNostrChat composable, transitioning to a more modular chat service approach. - Eliminate ChatPage.vue as part of the refactor to enhance code organization and maintainability.
This commit is contained in:
parent
fbac1e079e
commit
ee8dd37761
7 changed files with 12 additions and 657 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { eventBus } from '@/core/event-bus'
|
||||
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
import { nip04, getEventHash, finalizeEvent, type Event, type EventTemplate } from 'nostr-tools'
|
||||
import { nip04, finalizeEvent, type Event, type EventTemplate } from 'nostr-tools'
|
||||
import type { ChatMessage, ChatPeer, UnreadMessageData, ChatConfig } from '../types'
|
||||
import { getAuthToken } from '@/lib/config/lnbits'
|
||||
import { config } from '@/lib/config'
|
||||
|
|
@ -439,7 +439,7 @@ export class ChatService {
|
|||
try {
|
||||
const isFromUs = event.pubkey === userPubkey
|
||||
const peerPubkey = isFromUs
|
||||
? event.tags.find(tag => tag[0] === 'p')?.[1] // Get recipient from tag
|
||||
? event.tags.find((tag: string[]) => tag[0] === 'p')?.[1] // Get recipient from tag
|
||||
: event.pubkey // Sender is the peer
|
||||
|
||||
if (!peerPubkey || peerPubkey === userPubkey) continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue