Skip to content

Commit

Permalink
Do not show time series window when location not in filterIds locations
Browse files Browse the repository at this point in the history
  • Loading branch information
wkramer committed Dec 18, 2024
1 parent 7fb448d commit ff54588
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/components/spatialdisplay/SpatialDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { computed, ref, watch } from 'vue'
import SpatialDisplayComponent from '@/components/spatialdisplay/SpatialDisplayComponent.vue'
import { useDisplay } from 'vuetify'
import { configManager } from '@/services/application-config'
import { onBeforeRouteUpdate, type RouteLocationNormalized, useRoute, useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { findParentRoute } from '@/router'
import { onMounted } from 'vue'
import {
Expand Down Expand Up @@ -255,11 +255,23 @@ function closeTimeSeriesDisplay(): void {
}
watch(
() => props.layerName,
() => locations.value,
() => {
if (currentLocationId.value && !props.locationId) {
openLocationTimeSeriesDisplay(currentLocationId.value)
if (
locations.value?.find((l) => l.locationId === currentLocationId.value)
) {
openLocationTimeSeriesDisplay(currentLocationId.value)
} else {
currentLocationId.value = undefined
}
}
},
)
watch(
() => props.layerName,
() => {
if (
currentLatitude.value &&
currentLongitude.value &&
Expand All @@ -273,12 +285,6 @@ watch(
}
},
)
onBeforeRouteUpdate(reroute)
function reroute(to: RouteLocationNormalized) {
console.log('Spatial Display', to)
}
</script>

<style scoped>
Expand Down

0 comments on commit ff54588

Please sign in to comment.