mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
20 lines
453 B
TypeScript
20 lines
453 B
TypeScript
export const prerender = false;
|
|
import { redirect } from '@sveltejs/kit';
|
|
import { api } from '@api';
|
|
import { browser } from '$app/env';
|
|
import type { PageLoad } from './$types';
|
|
|
|
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
|
|
};
|
|
}
|
|
};
|