0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-25 02:41:37 -05:00
immich/web/src/routes/+page.ts

20 lines
461 B
TypeScript

export const prerender = false;
import { redirect } from '@sveltejs/kit';
import { api } from '@api';
import type { PageLoad } from './$types';
import { browser } from '$app/environment';
export const load: PageLoad = async ({ parent }) => {
const { user } = await parent();
if (user) {
throw redirect(302, '/photos');
}
if (browser) {
const { data } = await api.userApi.getUserCount();
return {
isAdminUserExist: data.userCount != 0
};
}
};