🐛 Fixed title editor in editor

This commit is contained in:
Mawoka
2023-02-09 19:08:36 +01:00
parent abf1583a1d
commit 0e1e60de29
+20 -16
View File
@@ -28,6 +28,7 @@
export let pow_salt: string; export let pow_salt: string;
let uppyOpen = false; let uppyOpen = false;
let unique = {};
/*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/ /*eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }]*/
const correctTimeInput = (_) => { const correctTimeInput = (_) => {
@@ -41,6 +42,7 @@
.toString() .toString()
.slice(0, 3); .slice(0, 3);
} }
unique = {};
}; };
$: correctTimeInput(data.questions[selected_question].time); $: correctTimeInput(data.questions[selected_question].time);
/* /*
@@ -75,22 +77,24 @@
{:else} {:else}
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex justify-center pt-10 w-full"> <div class="flex justify-center pt-10 w-full">
{#await import('$lib/inline-editor.svelte')} {#key unique}
<Spinner my_20={false} /> {#await import('$lib/inline-editor.svelte')}
{:then c} <Spinner my_20={false} />
<div {:then c}
class="rounded-lg placeholder:italic placeholder:font-normal dark:bg-gray-500" <div
class:bg-yellow-500={!reach( class="rounded-lg placeholder:italic placeholder:font-normal dark:bg-gray-500"
dataSchema, class:bg-yellow-500={!reach(
'questions[].question' dataSchema,
).isValidSync(data.questions[selected_question].question)} 'questions[].question'
> ).isValidSync(data.questions[selected_question].question)}
<svelte:component >
this={c.default} <svelte:component
bind:text={data.questions[selected_question].question} this={c.default}
/> bind:text={data.questions[selected_question].question}
</div> />
{/await} </div>
{/await}
{/key}
</div> </div>
{#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''} {#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''}
<div class="flex justify-center pt-10 w-full max-h-72"> <div class="flex justify-center pt-10 w-full max-h-72">