Fix: add awaitAnimationFrame to fix non-working questions

This commit is contained in:
Pieter Vander Vennet 2024-04-03 01:01:38 +02:00
parent 073cd692e4
commit d744fd3a42

View file

@ -71,13 +71,13 @@
let firstQuestion: UIEventSource<TagRenderingConfig> = new UIEventSource<TagRenderingConfig>(undefined)
let allQuestionsToAsk : UIEventSource<TagRenderingConfig[]> = new UIEventSource<TagRenderingConfig[]>([])
function calculateQuestions(){
async function calculateQuestions(){
console.log("Applying questions to ask")
const qta = questionsToAsk.data
firstQuestion.setData(undefined)
firstQuestion.setData(qta[0])
allQuestionsToAsk.setData([])
await Utils.awaitAnimationFrame()
firstQuestion.setData(qta[0])
allQuestionsToAsk.setData(qta)
}