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,
|
setMapViewMode,
|
||||||
entityColors,
|
entityColors,
|
||||||
selectItem,
|
selectItem,
|
||||||
|
startSelect,
|
||||||
cancelSelect,
|
cancelSelect,
|
||||||
openInfo,
|
openInfo,
|
||||||
closeInfo,
|
closeInfo,
|
||||||
@@ -337,6 +338,24 @@ watch([filterByBounds, urlBounds], ([enabled, urlB]) => {
|
|||||||
setProductBoundsFilter(boundsToApply)
|
setProductBoundsFilter(boundsToApply)
|
||||||
}, { immediate: true })
|
}, { 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 to load info data
|
||||||
watch(infoId, async (info) => {
|
watch(infoId, async (info) => {
|
||||||
if (info) {
|
if (info) {
|
||||||
|
|||||||
Reference in New Issue
Block a user