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