Auto-open selection in Explore
All checks were successful
Build Docker Image / build (push) Successful in 5m0s
All checks were successful
Build Docker Image / build (push) Successful in 5m0s
This commit is contained in:
@@ -167,6 +167,7 @@ const {
|
||||
setMapViewMode,
|
||||
entityColors,
|
||||
selectItem,
|
||||
startSelect,
|
||||
cancelSelect,
|
||||
openInfo,
|
||||
closeInfo,
|
||||
@@ -337,6 +338,24 @@ watch([filterByBounds, urlBounds], ([enabled, urlB]) => {
|
||||
setProductBoundsFilter(boundsToApply)
|
||||
}, { immediate: true })
|
||||
|
||||
const selectModeForView = (mode: 'offers' | 'hubs' | 'suppliers') =>
|
||||
mode === 'hubs' ? 'hub' : mode === 'suppliers' ? 'supplier' : 'product'
|
||||
|
||||
const ensureExploreSelectionOpen = () => {
|
||||
if (catalogMode.value !== 'explore') return
|
||||
if (infoId.value) return
|
||||
if (showQuoteResults.value) return
|
||||
|
||||
const desired = selectModeForView(mapViewMode.value)
|
||||
if (selectMode.value !== desired) {
|
||||
startSelect(desired)
|
||||
}
|
||||
}
|
||||
|
||||
watch([catalogMode, mapViewMode, infoId], () => {
|
||||
ensureExploreSelectionOpen()
|
||||
}, { immediate: true })
|
||||
|
||||
// Watch infoId to load info data
|
||||
watch(infoId, async (info) => {
|
||||
if (info) {
|
||||
|
||||
Reference in New Issue
Block a user