2025-05-09 16:00:58 -05:00
|
|
|
<script lang="ts">
|
2025-05-15 09:35:21 -06:00
|
|
|
import PinCodeChangeForm from '$lib/components/user-settings-page/PinCodeChangeForm.svelte';
|
|
|
|
|
import PinCodeCreateForm from '$lib/components/user-settings-page/PinCodeCreateForm.svelte';
|
|
|
|
|
import { getAuthStatus } from '@immich/sdk';
|
2025-05-09 16:00:58 -05:00
|
|
|
import { onMount } from 'svelte';
|
|
|
|
|
import { fade } from 'svelte/transition';
|
|
|
|
|
|
|
|
|
|
let hasPinCode = $state(false);
|
|
|
|
|
|
|
|
|
|
onMount(async () => {
|
2025-05-15 09:35:21 -06:00
|
|
|
const { pinCode } = await getAuthStatus();
|
|
|
|
|
hasPinCode = pinCode;
|
2025-05-09 16:00:58 -05:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<section class="my-4">
|
2025-05-15 09:35:21 -06:00
|
|
|
{#if hasPinCode}
|
|
|
|
|
<div in:fade={{ duration: 200 }} class="mt-6">
|
|
|
|
|
<PinCodeChangeForm />
|
|
|
|
|
</div>
|
|
|
|
|
{:else}
|
|
|
|
|
<div in:fade={{ duration: 200 }} class="mt-6">
|
|
|
|
|
<PinCodeCreateForm onCreated={() => (hasPinCode = true)} />
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
2025-05-09 16:00:58 -05:00
|
|
|
</section>
|