mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
feat(web)!: SPA (#5069)
* feat(web): SPA * chore: remove unnecessary prune * feat(web): merge with immich-server * Correct method name * fix: bugs, docs, workflows, etc. * chore: keep dockerignore for dev * chore: remove license * fix: expose 2283 --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
25
web/src/routes/+layout.ts
Normal file
25
web/src/routes/+layout.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { api } from '../api';
|
||||
import type { LayoutLoad } from './$types';
|
||||
|
||||
const getUser = async () => {
|
||||
try {
|
||||
const { data: user } = await api.userApi.getMyUserInfo();
|
||||
return user;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export const ssr = false;
|
||||
export const csr = true;
|
||||
|
||||
export const load = (async () => {
|
||||
const user = await getUser();
|
||||
|
||||
return {
|
||||
user,
|
||||
meta: {
|
||||
title: 'Immich',
|
||||
},
|
||||
};
|
||||
}) satisfies LayoutLoad;
|
||||
Reference in New Issue
Block a user