fix(ui): restrict private phone discovery to pixel keyword

This commit is contained in:
yaya
2026-10-09 17:30:04 +01:00
parent dd909040f8
commit ecac80dfcb
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -63,7 +63,8 @@ windows can scroll normally rather than collapsing the model to zero height.
The router gateway and private-phone Setup goal share `HardwareMarketplace.vue`. The router gateway and private-phone Setup goal share `HardwareMarketplace.vue`.
Buy router / Buy phone replaces the model with a horizontal product carousel, Buy router / Buy phone replaces the model with a horizontal product carousel,
preserving the outer container's height. Discovery queries enabled relays from preserving the outer container's height. Discovery queries enabled relays from
`nostr.list-relays` for NIP-99 kind-30402 events. Development builds show clearly `nostr.list-relays` for NIP-99 kind-30402 events. Phone discovery uses the `pixel`
keyword. Development builds show clearly
labeled sample listings when no matching live listings are found. Checkout and labeled sample listings when no matching live listings are found. Checkout and
the product View/Buy actions remain unimplemented. the product View/Buy actions remain unimplemented.
@@ -30,7 +30,7 @@ const DEV_PHONE_LISTINGS: HardwareListing[] = [
{ id: 'dev-pixel-10', pubkey: 'phone-demo-seller', title: 'Pixel 10 · GrapheneOS ready', summary: 'A newer Pixel for private, independent mobile computing.', content: '', location: 'Amsterdam, NL', status: 'active', image: '/assets/img/phone-mockups/pixel-10.webp', price: { amount: '699', currency: 'EUR' }, relay: 'development mock' }, { id: 'dev-pixel-10', pubkey: 'phone-demo-seller', title: 'Pixel 10 · GrapheneOS ready', summary: 'A newer Pixel for private, independent mobile computing.', content: '', location: 'Amsterdam, NL', status: 'active', image: '/assets/img/phone-mockups/pixel-10.webp', price: { amount: '699', currency: 'EUR' }, relay: 'development mock' },
] ]
const devListings = computed(() => props.kind === 'phone' ? DEV_PHONE_LISTINGS : DEV_ROUTER_LISTINGS) const devListings = computed(() => props.kind === 'phone' ? DEV_PHONE_LISTINGS : DEV_ROUTER_LISTINGS)
const topicTags = computed(() => props.kind === 'phone' ? ['pixel', 'grapheneos', 'privacy-phone'] : ['openwrt', 'router', 'gl-inet', 'beryl', 'flint']) const topicTags = computed(() => props.kind === 'phone' ? ['pixel'] : ['openwrt', 'router', 'gl-inet', 'beryl', 'flint'])
const open = ref(false) const open = ref(false)
const carousel = ref<HTMLElement>() const carousel = ref<HTMLElement>()
const listings = ref<HardwareListing[]>([]) const listings = ref<HardwareListing[]>([])
@@ -49,7 +49,7 @@ function matchesHardware(item: { title: string; summary: string; content: string
const tags = item.tags?.flat().join(' ') ?? '' const tags = item.tags?.flat().join(' ') ?? ''
const text = `${item.title} ${item.summary} ${item.content} ${tags}` const text = `${item.title} ${item.summary} ${item.content} ${tags}`
return props.kind === 'phone' return props.kind === 'phone'
? /\bpixel\b|grapheneos/i.test(text) ? /\bpixel\b/i.test(text)
: /openwrt|gl[- .]?inet|beryl|flint|nanopi|gl-mt3000|gl-mt6000/i.test(text) : /openwrt|gl[- .]?inet|beryl|flint|nanopi|gl-mt3000|gl-mt6000/i.test(text)
} }
function parse(event: { function parse(event: {