From f22784b711222e768c86f76eccb4b98942d937c5 Mon Sep 17 00:00:00 2001 From: Simon Wiles Date: Wed, 15 Sep 2021 11:23:11 -0700 Subject: [PATCH] Generic fix for the `` not always updating This is bit of a kludge to address the problem of the `` component getting into an inconsistent state if it's not destroyed properly when a new roll is selected. The problem is caused when ``s lifecycle `onDestroy` method is not called, which can happen when it's removed while one or more of its children are in the middle of a `transition` (see https://github.com/sveltejs/svelte/issues/5268). One option would be to remove all Svelte `transition`s on child elements (the "Downloading roll image..." message, ``, and ``) but this seems a shame. In my testing, this fix seems to address the problem without needing to remove the `transition`s. --- src/Pianolatron.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Pianolatron.svelte b/src/Pianolatron.svelte index 425aacf5..1c10b9fc 100644 --- a/src/Pianolatron.svelte +++ b/src/Pianolatron.svelte @@ -162,6 +162,7 @@ }; const resetApp = () => { + rollViewer?.$destroy(); mididataReady = false; clearNotification(); appReady = false;