mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 05:02:58 +03:00
fix: dark oidc client icons not saved on client creation (#1057)
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
import { m } from '$lib/paraglide/messages';
|
import { m } from '$lib/paraglide/messages';
|
||||||
import type { OidcClientMetaData } from '$lib/types/oidc.type';
|
import type { OidcClientMetaData } from '$lib/types/oidc.type';
|
||||||
import { cachedOidcClientLogo } from '$lib/utils/cached-image-util';
|
import { cachedOidcClientLogo } from '$lib/utils/cached-image-util';
|
||||||
|
import { mode } from 'mode-watcher';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
success,
|
success,
|
||||||
@@ -28,6 +29,8 @@
|
|||||||
animationDone = false;
|
animationDone = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isLightMode = $derived(mode.current === 'light');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex justify-center gap-3">
|
<div class="flex justify-center gap-3">
|
||||||
@@ -60,8 +63,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else if client.hasLogo}
|
{:else if client.hasLogo}
|
||||||
<img
|
<img
|
||||||
class="size-10 aspect-square object-contain"
|
class="aspect-square size-10 object-contain"
|
||||||
src={cachedOidcClientLogo.getUrl(client.id)}
|
src={cachedOidcClientLogo.getUrl(client.id, isLightMode)}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
alt={m.client_logo()}
|
alt={m.client_logo()}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -21,9 +21,15 @@
|
|||||||
async function createOIDCClient(client: OidcClientCreateWithLogo) {
|
async function createOIDCClient(client: OidcClientCreateWithLogo) {
|
||||||
try {
|
try {
|
||||||
const createdClient = await oidcService.createClient(client);
|
const createdClient = await oidcService.createClient(client);
|
||||||
if (client.logo) {
|
|
||||||
await oidcService.updateClientLogo(createdClient, client.logo);
|
const logoPromise = client.logo
|
||||||
}
|
? oidcService.updateClientLogo(createdClient, client.logo, true)
|
||||||
|
: Promise.resolve();
|
||||||
|
const darkLogoPromise = client.darkLogo
|
||||||
|
? oidcService.updateClientLogo(createdClient, client.darkLogo, false)
|
||||||
|
: Promise.resolve();
|
||||||
|
await Promise.all([logoPromise, darkLogoPromise]);
|
||||||
|
|
||||||
const clientSecret = await oidcService.createClientSecret(createdClient.id);
|
const clientSecret = await oidcService.createClientSecret(createdClient.id);
|
||||||
clientSecretStore.set(clientSecret);
|
clientSecretStore.set(clientSecret);
|
||||||
goto(`/settings/admin/oidc-clients/${createdClient.id}`);
|
goto(`/settings/admin/oidc-clients/${createdClient.id}`);
|
||||||
|
|||||||
@@ -113,5 +113,5 @@
|
|||||||
</Card.Root>
|
</Card.Root>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SignupTokenModal bind:open={signupTokenModalOpen} />
|
<SignupTokenModal bind:open={signupTokenModalOpen} />
|
||||||
<SignupTokenListModal bind:open={signupTokenListModalOpen} />
|
<SignupTokenListModal bind:open={signupTokenListModalOpen} />
|
||||||
|
|||||||
Reference in New Issue
Block a user