🚨 Fixed linter warnings
This commit is contained in:
@@ -1,37 +1,20 @@
|
||||
<script lang="ts">
|
||||
import { getLocalization } from '$lib/i18n';
|
||||
import { mint } from '$lib/hashcash';
|
||||
import { dataSchema } from '$lib/yupSchemas';
|
||||
import type { EditorData, Question, Answer } from './quiz_types';
|
||||
import type { EditorData, Question } from './quiz_types';
|
||||
import Sidebar from '$lib/editor/sidebar.svelte';
|
||||
import SettingsCard from '$lib/editor/settings-card.svelte';
|
||||
import QuizCard from '$lib/editor/card.svelte';
|
||||
import Spinner from './Spinner.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
const { t } = getLocalization();
|
||||
|
||||
let schemaInvalid = false;
|
||||
let yupErrorMessage = '';
|
||||
|
||||
export let data: EditorData;
|
||||
export let submit_button_text = 'Create';
|
||||
export let quiz_id: string | null;
|
||||
let selected_question = -1;
|
||||
let imgur_links_valid = false;
|
||||
|
||||
const empty_question: Question = {
|
||||
question: '',
|
||||
time: '20',
|
||||
image: '',
|
||||
answers: [
|
||||
{
|
||||
right: false,
|
||||
answer: ''
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const validateInput = async (data: EditorData) => {
|
||||
try {
|
||||
await dataSchema.validate(data, { abortEarly: false });
|
||||
@@ -61,11 +44,6 @@
|
||||
};
|
||||
|
||||
$: imgur_links_valid = checkIfAllQuestionImagesComplyWithRegex(data.questions);
|
||||
|
||||
const empty_answer: Answer = {
|
||||
right: false,
|
||||
answer: ''
|
||||
};
|
||||
let edit_id;
|
||||
let confirm_to_leave = true;
|
||||
let pow_data;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
uppy.on('upload-success', (file, response) => {
|
||||
image_id = response.body.id;
|
||||
});
|
||||
uppy.on('complete', (res) => {
|
||||
uppy.on('complete', (_) => {
|
||||
console.log(pow_data);
|
||||
data.questions[
|
||||
selected_question
|
||||
|
||||
@@ -29,7 +29,6 @@ export const mint = async (
|
||||
const zeros = '0'.repeat(hex_digits);
|
||||
const salt = gen_salt(saltchars);
|
||||
const challenge = `${ver}:${bits}:${ts}:${resource}:${ext}:${salt}`;
|
||||
let digest: string;
|
||||
let counter = 0;
|
||||
let result: string;
|
||||
while (true) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
const URLSearchParamsToObject = (params: URLSearchParams) => {
|
||||
let obj = {};
|
||||
const obj = {};
|
||||
params.forEach((v: string, k: string) => {
|
||||
obj[k] = v;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user