refactor: Remove MarketTest page and update Navbar navigation
- Delete MarketTest.vue as it is no longer needed for testing purposes. - Remove the corresponding route from the router configuration. - Update Navbar.vue to eliminate the 'Market Test' navigation item, streamlining the navigation options.
This commit is contained in:
parent
670270ca91
commit
9e02574c27
3 changed files with 1 additions and 95 deletions
|
|
@ -29,7 +29,6 @@ const navigation = computed<NavigationItem[]>(() => [
|
|||
{ name: t('nav.home'), href: '/' },
|
||||
{ name: t('nav.events'), href: '/events' },
|
||||
{ name: t('nav.market'), href: '/market' },
|
||||
{ name: 'Market Test', href: '/market-test' },
|
||||
])
|
||||
|
||||
// Compute total wallet balance
|
||||
|
|
|
|||
|
|
@ -1,85 +0,0 @@
|
|||
<template>
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<h1 class="text-2xl font-bold mb-4">Market Loading Test</h1>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<strong>Loading State:</strong> {{ marketStore.isLoading }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Error State:</strong> {{ marketStore.error }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Connected:</strong> {{ market.isConnected }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Active Market:</strong> {{ marketStore.activeMarket ? 'Yes' : 'No' }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Products Count:</strong> {{ marketStore.products.length }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Stalls Count:</strong> {{ marketStore.stalls.length }}
|
||||
</div>
|
||||
|
||||
<Button @click="testLoadMarket" :disabled="marketStore.isLoading">
|
||||
{{ marketStore.isLoading ? 'Loading...' : 'Test Load Market' }}
|
||||
</Button>
|
||||
|
||||
<Button @click="clearError" variant="outline">
|
||||
Clear Error
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div v-if="marketStore.error" class="mt-4 p-4 bg-red-100 border border-red-400 rounded">
|
||||
<strong>Error:</strong> {{ marketStore.error }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useMarketStore } from '@/stores/market'
|
||||
import { useMarket } from '@/composables/useMarket'
|
||||
import { config } from '@/lib/config'
|
||||
import { Button } from '@/components/ui/button'
|
||||
|
||||
const marketStore = useMarketStore()
|
||||
const market = useMarket()
|
||||
|
||||
const testLoadMarket = async () => {
|
||||
try {
|
||||
console.log('=== Starting Market Test ===')
|
||||
|
||||
const naddr = config.market.defaultNaddr
|
||||
console.log('Naddr:', naddr)
|
||||
|
||||
if (!naddr) {
|
||||
marketStore.setError('No market naddr configured')
|
||||
return
|
||||
}
|
||||
|
||||
console.log('Connecting to market...')
|
||||
await market.connectToMarket()
|
||||
console.log('Connected to market')
|
||||
|
||||
console.log('Loading market...')
|
||||
await market.loadMarket(naddr)
|
||||
console.log('Market loaded')
|
||||
|
||||
console.log('=== Market Test Complete ===')
|
||||
|
||||
} catch (error) {
|
||||
console.error('Test failed:', error)
|
||||
marketStore.setError(error instanceof Error ? error.message : 'Test failed')
|
||||
}
|
||||
}
|
||||
|
||||
const clearError = () => {
|
||||
marketStore.setError(null)
|
||||
}
|
||||
</script>
|
||||
|
|
@ -49,15 +49,7 @@ const router = createRouter({
|
|||
requiresAuth: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/market-test',
|
||||
name: 'market-test',
|
||||
component: () => import('@/pages/MarketTest.vue'),
|
||||
meta: {
|
||||
title: 'Market Test',
|
||||
requiresAuth: true
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue