From f5df70fba87f58f7becdd0ab02ab142c73176872 Mon Sep 17 00:00:00 2001 From: Alex <$(pass /github/email)> Date: Sun, 2 Mar 2025 23:57:52 +0100 Subject: [PATCH] fixing licence missing edge case --- frontend/src/lib/components/UserEditForm.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/lib/components/UserEditForm.svelte b/frontend/src/lib/components/UserEditForm.svelte index 3f279c6..b3375b9 100644 --- a/frontend/src/lib/components/UserEditForm.svelte +++ b/frontend/src/lib/components/UserEditForm.svelte @@ -6,6 +6,7 @@ import { hasPrivilige, receive, send } from '$lib/utils/helpers'; import { t } from 'svelte-i18n'; import { PERMISSIONS } from '$lib/utils/constants'; + import { defaultLicence } from '$lib/utils/defaults'; /** @type {import('../../routes/auth/about/[id]/$types').ActionData} */ export let form; @@ -16,6 +17,11 @@ /** @type {App.Locals['user']} */ export let user; + // Ensure licence is initialized before passing to child + $: if (user && !user.licence) { + user.licence = defaultLicence(); + } + /** @type {App.Locals['user']} */ export let editor;