Fixed an error where checks were being compared against "Undefined" due to lack of integer parsing in the update_breakdown() function.
This commit is contained in:
		
							parent
							
								
									25f664ee4e
								
							
						
					
					
						commit
						db17504ea0
					
				
					 2 changed files with 16 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -930,12 +930,12 @@ async function update_breakdown(scene, checks, entrances) {
 | 
			
		|||
 | 
			
		||||
	// Check for changes, and if so, update
 | 
			
		||||
	if (
 | 
			
		||||
		breakdown_checks.dataset.checksCollected !=
 | 
			
		||||
		parseInt(breakdown_checks.dataset.checksCollected) !=
 | 
			
		||||
		checks.collected + checks.found
 | 
			
		||||
	) {
 | 
			
		||||
		update_breakdown_checks(scene, checks);
 | 
			
		||||
	}
 | 
			
		||||
	if (breakdown_entrances.dataset.entrancesFound != entrances.found) {
 | 
			
		||||
	if (parseInt(breakdown_entrances.dataset.entrancesFound) != entrances.found) {
 | 
			
		||||
		update_breakdown_entrances(scene, entrances);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -945,9 +945,11 @@ async function update_breakdown_list(data, changed) {
 | 
			
		|||
	if (changed.checks) {
 | 
			
		||||
		Object.keys(data.scenes).forEach((scene) =>
 | 
			
		||||
			update_breakdown(scene, data.scenes[scene], {
 | 
			
		||||
				found: document.querySelector(
 | 
			
		||||
					`.breakdown[data-scene="${scene}"] .breakdown-block-entrances-title`
 | 
			
		||||
				).dataset.entrancesFound,
 | 
			
		||||
				found: parseInt(
 | 
			
		||||
					document.querySelector(
 | 
			
		||||
						`.breakdown[data-scene="${scene}"] .breakdown-block-entrances-title`
 | 
			
		||||
					).dataset.entrancesFound
 | 
			
		||||
				),
 | 
			
		||||
			})
 | 
			
		||||
		);
 | 
			
		||||
	} else if (changed.entrances) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,13 +1,13 @@
 | 
			
		|||
<form action="{% url "set_settings" %}"
 | 
			
		||||
      method="post"
 | 
			
		||||
      class="flex flex-row space-x-2">
 | 
			
		||||
    <div class="w-full rounded-lg border-none shadow-[inset_0_35px_60px_-15px_rgba(0,0,0,0.3)] bg-charcoal-translucent-light"
 | 
			
		||||
         hidden></div>
 | 
			
		||||
    {% csrf_token %}
 | 
			
		||||
    <label for="backend-filepath-form"
 | 
			
		||||
           class="justify-center my-auto align-top min-w-fit text-md text-nowrap">AppData Path</label>
 | 
			
		||||
    {% for field in backend_filepath_form %}{{ field }}{% endfor %}
 | 
			
		||||
    <button type="submit"
 | 
			
		||||
            class="p-2 rounded-md bg-white bg-opacity-10 shadow-sm shadow-[#242424]"
 | 
			
		||||
            id="backend-filepath-form">Submit</button>
 | 
			
		||||
     <div class="w-full rounded-lg border-none shadow-[inset_0_35px_60px_-15px_rgba(0,0,0,0.3)] bg-charcoal-translucent-light"
 | 
			
		||||
          hidden></div>
 | 
			
		||||
     {% csrf_token %}
 | 
			
		||||
     <label for="backend-filepath-form"
 | 
			
		||||
            class="justify-center my-auto align-top min-w-fit text-md text-nowrap">AppData Path</label>
 | 
			
		||||
     {% for field in backend_filepath_form %}{{ field }}{% endfor %}
 | 
			
		||||
     <button type="submit"
 | 
			
		||||
             class="p-2 rounded-md bg-white bg-opacity-10 shadow-sm shadow-[#242424]"
 | 
			
		||||
             id="backend-filepath-form">Submit</button>
 | 
			
		||||
</form>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue