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:
parent
55e99e002d
commit
a08fd284e4
2 changed files with 0 additions and 48 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue