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>
<NuxtLoadingIndicator :height="3" />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>

View File

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