get correct time window from url
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-29 21:03:02 +02:00
parent 27cda7f222
commit 14d63294a3

View File

@@ -24,9 +24,13 @@ const activeWindow = ref<Window>(defaultWindow)
const router = useRouter()
const route = useRoute()
const urlEncodeWindow = (label: string) => label.replace(' ', '-')
if (route.params.type) activeType.value = route.params.type as NavType
if (route.params.window) {
activeWindow.value = windows.find((w) => w.label === route.params.window) || defaultWindow
console.log(route.params.window, windows)
activeWindow.value = windows.find((w) => urlEncodeWindow(w.label) === route.params.window) || defaultWindow
}
const updateRoute = () => {
@@ -35,7 +39,7 @@ const updateRoute = () => {
name: 'view',
params: {
type: activeType.value,
window: activeWindow.value?.label.replace(' ', '-')
window: urlEncodeWindow(activeWindow.value?.label)
}
}
router.push(route)