Added cover-image (Closes #103)

This commit is contained in:
Mawoka
2022-09-08 17:47:29 +02:00
parent 603e2834d6
commit 2ab9d14d3e
15 changed files with 186 additions and 29 deletions
+24 -2
View File
@@ -19,6 +19,22 @@
export let quiz_id: string | null;
let selected_question = -1;
let imgur_links_valid = false;
let pow_salt;
const computePOW = async (salt: string) => {
if (pow_salt === undefined) {
return;
}
console.log('Computing POW');
pow_data = await mint(salt, 16, '', 8, false);
pow_salt = undefined;
return;
};
$: {
pow_salt;
computePOW(pow_salt);
}
const validateInput = async (data: EditorData) => {
try {
@@ -156,9 +172,15 @@
</div>
<div class="w-full h-full">
{#if selected_question === -1}
<SettingsCard bind:data />
<SettingsCard bind:data bind:pow_salt bind:edit_id bind:pow_data />
{:else}
<QuizCard bind:data bind:selected_question bind:edit_id bind:pow_data />
<QuizCard
bind:data
bind:selected_question
bind:edit_id
bind:pow_data
bind:pow_salt
/>
{/if}
</div>
</div>