Co-authored-by: terraputix <terraputix@mailbox.org> Reviewed-on: useweb/ombrella#6
16 lines
444 B
TypeScript
16 lines
444 B
TypeScript
import { get } from 'svelte/store';
|
|
|
|
import { redirect } from '@sveltejs/kit';
|
|
|
|
import { storedLocation } from '$lib/stores/settings';
|
|
|
|
import { buildLocationRoute } from '$lib/utils/location';
|
|
|
|
import type { PageLoad } from './$types';
|
|
|
|
export const load = (async () => {
|
|
const location = get(storedLocation);
|
|
const locationRoute = buildLocationRoute(location);
|
|
throw redirect(303, '/weather/week/' + locationRoute);
|
|
}) satisfies PageLoad;
|