Auto-trigger quote search on prefilled URLs
Some checks failed
Build Docker Image / build (push) Has been cancelled
Some checks failed
Build Docker Image / build (push) Has been cancelled
This commit is contained in:
@@ -397,6 +397,16 @@ const offers = ref<OfferResult[]>([])
|
|||||||
const offersLoading = ref(false)
|
const offersLoading = ref(false)
|
||||||
const showQuoteResults = 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
|
// Watch for search trigger from topnav
|
||||||
const searchTrigger = useState<number>('catalog-search-trigger', () => 0)
|
const searchTrigger = useState<number>('catalog-search-trigger', () => 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user