fix: OIDC client logo gets removed if other properties get updated

This commit is contained in:
Elias Schneider
2024-12-17 19:00:33 +01:00
parent aeda512cb7
commit 789d9394a5
3 changed files with 7 additions and 4 deletions

View File

@@ -22,7 +22,7 @@
} = $props();
let isLoading = $state(false);
let logo = $state<File | null>(null);
let logo = $state<File | null | undefined>();
let logoDataURL: string | null = $state(
existingClient?.hasLogo ? `/api/oidc/clients/${existingClient!.id}/logo` : null
);
@@ -108,7 +108,7 @@
onchange={onLogoChange}
>
<Button variant="secondary">
{existingClient?.hasLogo ? 'Change Logo' : 'Upload Logo'}
{logoDataURL ? 'Change Logo' : 'Upload Logo'}
</Button>
</FileInput>
{#if logoDataURL}