mirror of
https://github.com/isledecomp/isle.pizza.git
synced 2026-03-01 06:17:38 +00:00
Conditionally render ScoreCube to properly clean up WebGL canvas
Only mount the ScoreCube component when on the save-editor page. This ensures onDestroy is called when navigating away, properly disposing of the WebGL renderer and removing the canvas from DOM.
This commit is contained in:
parent
3b02784c81
commit
f45831a4b4
@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import { currentPage } from '../../stores.js';
|
||||||
import ScoreCube from './ScoreCube.svelte';
|
import ScoreCube from './ScoreCube.svelte';
|
||||||
|
|
||||||
export let slot;
|
export let slot;
|
||||||
@ -13,10 +14,12 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="scores-editor">
|
<div class="scores-editor">
|
||||||
|
{#if $currentPage === 'save-editor'}
|
||||||
<ScoreCube
|
<ScoreCube
|
||||||
missions={missionData}
|
missions={missionData}
|
||||||
onUpdate={handleCubeUpdate}
|
onUpdate={handleCubeUpdate}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user