fix: make explore navigation explicit and add route loading indicator

This commit is contained in:
Ruslan Bakiev
2026-03-14 10:59:02 +07:00
parent 803dad5c8f
commit b7f452cdd1
2 changed files with 22 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
<template> <template>
<NuxtLoadingIndicator :height="3" />
<NuxtLayout> <NuxtLayout>
<NuxtPage /> <NuxtPage />
</NuxtLayout> </NuxtLayout>

View File

@@ -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)