Clear inactive clusters on view switch
All checks were successful
Build Docker Image / build (push) Successful in 4m27s

This commit is contained in:
Ruslan Bakiev
2026-02-06 14:06:37 +07:00
parent 1e761ca2a8
commit a3e7c92915
2 changed files with 13 additions and 6 deletions

View File

@@ -316,8 +316,15 @@ const clusterLoading = computed(() => {
return offerClusters.loading.value
})
const clearInactiveClusters = (active: 'offer' | 'hub' | 'supplier') => {
if (active !== 'offer') offerClusters.clearNodes()
if (active !== 'hub') hubClusters.clearNodes()
if (active !== 'supplier') supplierClusters.clearNodes()
}
const fetchActiveClusters = async () => {
if (!currentBounds.value) return
clearInactiveClusters(activeClusterType.value)
if (activeClusterType.value === 'hub') {
await hubClusters.fetchClusters(currentBounds.value)
return
@@ -333,6 +340,7 @@ const fetchActiveClusters = async () => {
watch(mapViewMode, async () => {
if (!props.useServerClustering) return
if (useTypedClusters.value) {
clearInactiveClusters(activeClusterType.value)
if (currentBounds.value) {
await fetchActiveClusters()
}