Auto-trigger quote search on prefilled URLs
Some checks failed
Build Docker Image / build (push) Has been cancelled

This commit is contained in:
Ruslan Bakiev
2026-02-06 18:21:09 +07:00
parent 269d801493
commit d877eff212

View File

@@ -397,6 +397,16 @@ const offers = ref<OfferResult[]>([])
const offersLoading = ref(false)
const showQuoteResults = ref(false)
// Auto-run quote search when landing on a prefilled quote URL (mode=quote + filters)
watch(
() => [catalogMode.value, canSearch.value],
() => {
if (catalogMode.value === 'quote' && canSearch.value && !showQuoteResults.value && !offersLoading.value) {
onSearch()
}
},
{ immediate: true }
)
// Watch for search trigger from topnav
const searchTrigger = useState<number>('catalog-search-trigger', () => 0)