fix: make explore navigation explicit and add route loading indicator
This commit is contained in:
@@ -370,15 +370,29 @@ export function useCatalogSearch() {
|
||||
})
|
||||
|
||||
const setCatalogMode = (newMode: CatalogMode) => {
|
||||
const defaultSelect: SelectMode = selectMode.value
|
||||
|| (mapViewMode.value === 'hubs' ? 'hub'
|
||||
: mapViewMode.value === 'suppliers' ? 'supplier'
|
||||
: 'product')
|
||||
const catalogPath = localePath('/catalog')
|
||||
const isCatalogRoute = route.path.startsWith(catalogPath)
|
||||
|
||||
if (newMode === 'explore') {
|
||||
updateQuery({ mode: newMode, qty: null, select: defaultSelect })
|
||||
} else {
|
||||
updateQuery({ mode: newMode, select: defaultSelect })
|
||||
// Always make Explore a clean navigation to map page without intermediate select state.
|
||||
if (!isCatalogRoute) {
|
||||
router.push({ path: catalogPath })
|
||||
return
|
||||
}
|
||||
|
||||
updateQuery({
|
||||
mode: null,
|
||||
qty: null,
|
||||
select: null,
|
||||
info: null,
|
||||
infoTab: null,
|
||||
infoProduct: null
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// Quote mode is a dedicated flow that starts from product step.
|
||||
router.push({ path: localePath('/catalog/product') })
|
||||
}
|
||||
|
||||
// Can search for offers (product + hub or product + supplier required)
|
||||
|
||||
Reference in New Issue
Block a user