get correct time window from url
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user