mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00: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:
parent
4290a29107
commit
7a1f25b515
6 changed files with 41 additions and 27 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue