fix: make explore navigation explicit and add route loading indicator
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<NuxtLoadingIndicator :height="3" />
|
||||||
<NuxtLayout>
|
<NuxtLayout>
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
|
|||||||
@@ -370,15 +370,29 @@ export function useCatalogSearch() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const setCatalogMode = (newMode: CatalogMode) => {
|
const setCatalogMode = (newMode: CatalogMode) => {
|
||||||
const defaultSelect: SelectMode = selectMode.value
|
const catalogPath = localePath('/catalog')
|
||||||
|| (mapViewMode.value === 'hubs' ? 'hub'
|
const isCatalogRoute = route.path.startsWith(catalogPath)
|
||||||
: mapViewMode.value === 'suppliers' ? 'supplier'
|
|
||||||
: 'product')
|
|
||||||
if (newMode === 'explore') {
|
if (newMode === 'explore') {
|
||||||
updateQuery({ mode: newMode, qty: null, select: defaultSelect })
|
// Always make Explore a clean navigation to map page without intermediate select state.
|
||||||
} else {
|
if (!isCatalogRoute) {
|
||||||
updateQuery({ mode: newMode, select: defaultSelect })
|
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)
|
// Can search for offers (product + hub or product + supplier required)
|
||||||
|
|||||||
Reference in New Issue
Block a user