diff --git a/src/components/ui/logout-dialog/LogoutDialog.vue b/src/components/ui/logout-dialog/LogoutDialog.vue deleted file mode 100644 index 2451f0c..0000000 --- a/src/components/ui/logout-dialog/LogoutDialog.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - - - diff --git a/src/modules/market/composables/useMarket.ts b/src/modules/market/composables/useMarket.ts index 0659e2a..d86cca8 100644 --- a/src/modules/market/composables/useMarket.ts +++ b/src/modules/market/composables/useMarket.ts @@ -1,5 +1,4 @@ import { ref, computed, onMounted, onUnmounted, readonly } from 'vue' -import { useNostrStore } from '@/stores/nostr' import { useMarketStore } from '../stores/market' import { injectService, SERVICE_TOKENS } from '@/core/di-container' import { config } from '@/lib/config' @@ -16,7 +15,6 @@ const MARKET_EVENT_KINDS = { } as const export function useMarket() { - const nostrStore = useNostrStore() const marketStore = useMarketStore() const relayHub = injectService(SERVICE_TOKENS.RELAY_HUB) as any const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) as any @@ -61,7 +59,7 @@ export function useMarket() { const connectionStatus = computed(() => { if (connectionOperation.isLoading.value) return 'connecting' if (isConnected.value) return 'connected' - if (connectionOperation.error.value || nostrStore.error) return 'error' + if (connectionOperation.error.value || authService.error) return 'error' return 'disconnected' }) @@ -69,10 +67,9 @@ export function useMarket() { const loadMarket = async (naddr: string) => { return await marketOperation.execute(async () => { // Parse naddr to get market data - // TODO: Confirm if this should use nostrStore.account?.pubkey or authService.user.value?.pubkey const marketData = { identifier: naddr.split(':')[2] || 'default', - pubkey: naddr.split(':')[1] || nostrStore.account?.pubkey || '' + pubkey: naddr.split(':')[1] || authService.user.value?.pubkey || '' } if (!marketData.pubkey) { @@ -349,11 +346,9 @@ export function useMarket() { // Subscribe to order-related DMs (payment requests, status updates) const subscribeToOrderUpdates = (): (() => void) | null => { try { - // TODO: Confirm if this should use nostrStore.account?.pubkey or authService.user.value?.pubkey - const userPubkey = nostrStore.account?.pubkey || authService.user.value?.pubkey + const userPubkey = authService.user.value?.pubkey if (!userPubkey) { console.warn('Cannot subscribe to order updates: no user pubkey available', { - nostrStorePubkey: nostrStore.account?.pubkey, authServicePubkey: authService.user.value?.pubkey, isAuthenticated: authService.isAuthenticated.value }) @@ -389,12 +384,10 @@ export function useMarket() { try { console.log('🔔 Received order-related DM:', event.id, 'from:', event.pubkey.slice(0, 8)) - // TODO: Confirm if this should use nostrStore.account?.pubkey or authService.user.value?.pubkey - const userPrivkey = nostrStore.account?.privkey || authService.user.value?.prvkey + const userPrivkey = authService.user.value?.prvkey if (!userPrivkey) { console.warn('Cannot decrypt DM: no user private key available', { - nostrStorePrivkey: !!nostrStore.account?.privkey, authServicePrivkey: !!authService.user.value?.prvkey }) return @@ -575,10 +568,9 @@ export function useMarket() { // Load market data console.log('🛒 Loading basic market data...') - // TODO: Confirm if this should use nostrStore.account?.pubkey or authService.user.value?.pubkey await loadMarketData({ identifier: 'default', - pubkey: nostrStore.account?.pubkey || '' + pubkey: authService.user.value?.pubkey || '' }) // Load stalls and products only if connected @@ -614,7 +606,7 @@ export function useMarket() { // Initialize market on mount onMounted(async () => { - if (nostrStore.isConnected) { + if (relayHub.isConnected.value) { await connectToMarket() } }) diff --git a/src/modules/market/views/CheckoutPage.vue b/src/modules/market/views/CheckoutPage.vue index 84940b8..1483a30 100644 --- a/src/modules/market/views/CheckoutPage.vue +++ b/src/modules/market/views/CheckoutPage.vue @@ -272,7 +272,6 @@ import { ref, computed, onMounted } from 'vue' import { useRoute } from 'vue-router' import { useMarketStore } from '@/stores/market' -import { useNostrStore } from '@/stores/nostr' import { injectService, SERVICE_TOKENS } from '@/core/di-container' import { Card, @@ -292,7 +291,6 @@ import { const route = useRoute() const marketStore = useMarketStore() -const nostrStore = useNostrStore() const authService = injectService(SERVICE_TOKENS.AUTH_SERVICE) as any // State @@ -417,11 +415,11 @@ const placeOrder = async () => { isAuthenticated: authService.isAuthenticated.value, user: authService.user.value, hasPubkey: !!authService.user.value?.pubkey, - nostrPubkey: nostrStore.account?.pubkey + nostrPubkey: authService.user.value?.pubkey }) - // Get pubkey from auth service or fallback to nostr store - const userPubkey = authService.user.value?.pubkey || nostrStore.account?.pubkey + // Get pubkey from auth service + const userPubkey = authService.user.value?.pubkey if (!authService.isAuthenticated.value) { throw new Error('You must be logged in to place an order')