Remove sample product functionality from useMarket and useMarketPreloader for cleaner code and improved maintainability. This change eliminates the addition of sample products during market loading, streamlining the preloader's logic.

This commit is contained in:
padreug 2025-09-05 03:31:19 +02:00
parent 55e99e002d
commit a08fd284e4
2 changed files with 0 additions and 48 deletions

View file

@ -298,45 +298,6 @@ export function useMarket() {
}
}
// Add sample products for testing
const addSampleProducts = () => {
const sampleProducts = [
{
id: 'sample-1',
stall_id: 'sample-stall',
stallName: 'Sample Stall',
pubkey: nostrStore.account?.pubkey || '',
name: 'Sample Product 1',
description: 'This is a sample product for testing',
price: 1000,
currency: 'sats',
quantity: 1,
images: [],
categories: [],
createdAt: Math.floor(Date.now() / 1000),
updatedAt: Math.floor(Date.now() / 1000)
},
{
id: 'sample-2',
stall_id: 'sample-stall',
stallName: 'Sample Stall',
pubkey: nostrStore.account?.pubkey || '',
name: 'Sample Product 2',
description: 'Another sample product for testing',
price: 2000,
currency: 'sats',
quantity: 1,
images: [],
categories: [],
createdAt: Math.floor(Date.now() / 1000),
updatedAt: Math.floor(Date.now() / 1000)
}
]
sampleProducts.forEach(product => {
marketStore.addProduct(product)
})
}
// Subscribe to market updates
const subscribeToMarketUpdates = (): (() => void) | null => {
@ -521,9 +482,6 @@ export function useMarket() {
await loadProducts()
} else {
console.log('🛒 Skipping stalls/products loading - not connected to relays')
// Add sample products for demo mode
console.log('🛒 Adding sample products for offline demo...')
addSampleProducts()
}
// Subscribe to updates
@ -572,7 +530,6 @@ export function useMarket() {
loadMarket,
connectToMarket,
disconnectFromMarket,
addSampleProducts,
processPendingProducts,
publishProduct,
publishStall,

View file

@ -93,11 +93,6 @@ export function useMarketPreloader() {
marketStore.addMarket(fallbackMarket)
marketStore.setActiveMarket(fallbackMarket)
// Add some sample products if the useMarket composable supports it
if (market.addSampleProducts && typeof market.addSampleProducts === 'function') {
market.addSampleProducts()
}
isPreloaded.value = true
console.log('🛒 Market preload completed with fallback data')