Skip to content

Commit

Permalink
Generic fix for the <RollViewer/> not always updating
Browse files Browse the repository at this point in the history
This is bit of a kludge to address the problem of the `<RollViewer/>` component getting into an inconsistent state if it's not destroyed properly when a new roll is selected.  The problem is caused when `<RollViewer/>`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 sveltejs/svelte#5268).

One option would be to remove all Svelte `transition`s on child elements (the "Downloading roll image..." message, `<RollViewerControls/>`, and `<RollViewerScaleBar/>`) but this seems a shame.  In my testing, this fix seems to address the problem without needing to remove the `transition`s.
  • Loading branch information
simonwiles committed Sep 15, 2021
1 parent fb72ec0 commit f22784b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Pianolatron.svelte
Expand Up @@ -162,6 +162,7 @@
};
const resetApp = () => {
rollViewer?.$destroy();
mididataReady = false;
clearNotification();
appReady = false;
Expand Down

0 comments on commit f22784b

Please sign in to comment.