🐛 Fixed small errors in editor
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
yupErrorMessage = '';
|
yupErrorMessage = '';
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
schemaInvalid = true;
|
schemaInvalid = true;
|
||||||
yupErrorMessage = err.errors[0];
|
yupErrorMessage = err.errors ? err.errors[0] : '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$: validateInput(data);
|
$: validateInput(data);
|
||||||
|
|||||||
@@ -14,10 +14,6 @@
|
|||||||
|
|
||||||
export let selected_question: number;
|
export let selected_question: number;
|
||||||
export let data: EditorData;
|
export let data: EditorData;
|
||||||
console.log(
|
|
||||||
data.questions[selected_question].answers,
|
|
||||||
Array.isArray(data.questions[selected_question].answers)
|
|
||||||
);
|
|
||||||
if (!Array.isArray(data.questions[selected_question].answers)) {
|
if (!Array.isArray(data.questions[selected_question].answers)) {
|
||||||
data.questions[selected_question].answers = [];
|
data.questions[selected_question].answers = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,12 @@
|
|||||||
answer: '',
|
answer: '',
|
||||||
image: undefined
|
image: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
export let selected_question: number;
|
export let selected_question: number;
|
||||||
export let data: EditorData;
|
export let data: EditorData;
|
||||||
|
|
||||||
|
if (!Array.isArray(data.questions[selected_question].answers)) {
|
||||||
|
data.questions[selected_question].answers = [];
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (typeof data.questions[selected_question].answers[0].right === 'boolean') {
|
if (typeof data.questions[selected_question].answers[0].right === 'boolean') {
|
||||||
data.questions[selected_question].answers = [];
|
data.questions[selected_question].answers = [];
|
||||||
|
|||||||
@@ -67,7 +67,11 @@
|
|||||||
class="whitespace-nowrap truncate text-center w-full bg-transparent rounded dark:text-white"
|
class="whitespace-nowrap truncate text-center w-full bg-transparent rounded dark:text-white"
|
||||||
class:dark:text-black={selected_question === -1}
|
class:dark:text-black={selected_question === -1}
|
||||||
>
|
>
|
||||||
{@html data.title}
|
{#if data.title}
|
||||||
|
{@html data.title}
|
||||||
|
{:else}
|
||||||
|
<i>No title...</i>
|
||||||
|
{/if}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
initLocalizationContext();
|
initLocalizationContext();
|
||||||
|
|
||||||
if (import.meta.env.VITE_SENTRY !== undefined) {
|
if (import.meta.env.VITE_SENTRY !== undefined && import.meta.env.PROD) {
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: String(import.meta.env.VITE_SENTRY),
|
dsn: String(import.meta.env.VITE_SENTRY),
|
||||||
integrations: [new BrowserTracing()],
|
integrations: [new BrowserTracing()],
|
||||||
|
|||||||
Reference in New Issue
Block a user