fix: reduce the number of API requests when changing route (#14666)

* fix: reduce the number of API requests when changing route

* fix: reset `userInteraction` after sign out
This commit is contained in:
martin
2024-12-16 15:45:01 +01:00
committed by GitHub
parent 6b0f9ec46c
commit 8945a5d862
9 changed files with 63 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import { featureFlags } from '$lib/stores/server-config.store';
import { serverInfo } from '$lib/stores/server-info.store';
import { userInteraction } from '$lib/stores/user.svelte';
import { ByteUnit, convertToBytes } from '$lib/utils/byte-units';
import { handleError } from '$lib/utils/handle-error';
import { createUserAdmin } from '@immich/sdk';
@@ -34,7 +34,9 @@
let isCreatingUser = $state(false);
let quotaSizeInBytes = $derived(quotaSize ? convertToBytes(quotaSize, ByteUnit.GiB) : null);
let quotaSizeWarning = $derived(quotaSizeInBytes && quotaSizeInBytes > $serverInfo.diskSizeRaw);
let quotaSizeWarning = $derived(
quotaSizeInBytes && userInteraction.serverInfo && quotaSizeInBytes > userInteraction.serverInfo.diskSizeRaw,
);
$effect(() => {
if (password !== confirmPassword && confirmPassword.length > 0) {