From 3daac428533ec339869599366b7d58e9831b2dde Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 19 Mar 2024 01:53:45 +0100 Subject: [PATCH] Force refersh of _all_ questions to fix rendering bugs with svelte --- src/UI/Popup/TagRendering/Questionbox.svelte | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/UI/Popup/TagRendering/Questionbox.svelte b/src/UI/Popup/TagRendering/Questionbox.svelte index 4d485c29d..0c16ee977 100644 --- a/src/UI/Popup/TagRendering/Questionbox.svelte +++ b/src/UI/Popup/TagRendering/Questionbox.svelte @@ -68,12 +68,18 @@ }, [skippedQuestions] ) - let firstQuestion: UIEventSource = new UIEventSource() - + let firstQuestion: UIEventSource = new UIEventSource(undefined) + + let allQuestionsToAsk : UIEventSource = new UIEventSource([]) onDestroy(questionsToAsk.addCallback(qta => { firstQuestion.setData(undefined) firstQuestion.setData(qta[0]) + + allQuestionsToAsk.setData([]) + allQuestionsToAsk.setData(qta) })) + + let answered: number = 0 let skipped: number = 0 @@ -98,7 +104,7 @@ class="marker-questionbox-root" class:hidden={$questionsToAsk.length === 0 && skipped === 0 && answered === 0} > - {#if $questionsToAsk.length === 0} + {#if $allQuestionsToAsk.length === 0} {#if skipped + answered > 0}
@@ -146,7 +152,7 @@
{#if $showAllQuestionsAtOnce}
- {#each $questionsToAsk as question (question.id)} + {#each $allQuestionsToAsk as question (question.id)} {/each}