fixing licence missing edge case
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user