1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-30 05:29:30 +02:00

feat(web): add warning when setting a quota superior to the disk size (#6737)

* refactor: inline warning

* fix: do not use onmount

* chore: remove outdated comment

* wording

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
martin
2024-01-30 18:21:45 +01:00
committed by GitHub
parent 4290a29107
commit 7a1f25b515
6 changed files with 41 additions and 27 deletions

View File

@ -2,6 +2,7 @@ import { api } from '@api';
import { redirect } from '@sveltejs/kit';
import { AppRoute } from '../constants';
import { getSavedUser, setUser } from '$lib/stores/user.store';
import { serverInfo } from '$lib/stores/server-info.store';
export interface AuthOptions {
admin?: true;
@ -16,7 +17,6 @@ export const getAuthUser = async () => {
}
};
// TODO: re-use already loaded user (once) instead of fetching on each page navigation
export const authenticate = async (options?: AuthOptions) => {
options = options || {};
@ -36,6 +36,13 @@ export const authenticate = async (options?: AuthOptions) => {
}
};
export const requestServerInfo = async () => {
if (getSavedUser()) {
const { data } = await api.serverInfoApi.getServerInfo();
serverInfo.set(data);
}
};
export const isLoggedIn = async () => {
const savedUser = getSavedUser();
const user = savedUser || (await getAuthUser());