forked from MapComplete/MapComplete
		
	Force refersh of _all_ questions to fix rendering bugs with svelte
This commit is contained in:
		
							parent
							
								
									2bd1596b60
								
							
						
					
					
						commit
						3daac42853
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -68,13 +68,19 @@
 | 
			
		|||
    },
 | 
			
		||||
    [skippedQuestions]
 | 
			
		||||
  )
 | 
			
		||||
  let firstQuestion: UIEventSource<TagRenderingConfig> = new UIEventSource<TagRenderingConfig>()
 | 
			
		||||
  let firstQuestion: UIEventSource<TagRenderingConfig> = new UIEventSource<TagRenderingConfig>(undefined)
 | 
			
		||||
 | 
			
		||||
  let allQuestionsToAsk : UIEventSource<TagRenderingConfig[]> = new UIEventSource<TagRenderingConfig[]>([])
 | 
			
		||||
  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}
 | 
			
		||||
      <div class="thanks">
 | 
			
		||||
        <Tr t={Translations.t.general.questionBox.done} />
 | 
			
		||||
| 
						 | 
				
			
			@ -146,7 +152,7 @@
 | 
			
		|||
    <div>
 | 
			
		||||
      {#if $showAllQuestionsAtOnce}
 | 
			
		||||
        <div class="flex flex-col gap-y-1">
 | 
			
		||||
          {#each $questionsToAsk as question (question.id)}
 | 
			
		||||
          {#each $allQuestionsToAsk as question (question.id)}
 | 
			
		||||
            <TagRenderingQuestion config={question} {tags} {selectedElement} {state} {layer} />
 | 
			
		||||
          {/each}
 | 
			
		||||
        </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue