From f9fe31de1ad537854f0f0cf80560e35e22147bbe Mon Sep 17 00:00:00 2001 From: Remi PLANEL <rplanel@pasteur.fr> Date: Tue, 7 May 2024 12:54:40 +0200 Subject: [PATCH] fix bug when exiting with escape and the going to another page --- components/content/PdbeMolstarPlugin.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/content/PdbeMolstarPlugin.vue b/components/content/PdbeMolstarPlugin.vue index b3a327f3..50b52eef 100644 --- a/components/content/PdbeMolstarPlugin.vue +++ b/components/content/PdbeMolstarPlugin.vue @@ -65,10 +65,13 @@ function viewPdb(pdbPath: string | null) { } } - -function closeStructure() { +function emptyBasket() { selectedPdb.value = null structureBasket.set(undefined) +} + + +function closeStructure() { dialog.value = false } watch(selectedPdb, (newSelectedPdb, prevSelectPdb) => { @@ -78,6 +81,10 @@ watch(selectedPdb, (newSelectedPdb, prevSelectPdb) => { } }) +watch(dialog, (newDialog) => { + if (newDialog === false) emptyBasket() +}) + watchEffect(() => { const toValUrl = toValue(structureBasket).structures if (toValUrl && toValUrl?.length > 0) { @@ -89,6 +96,7 @@ watchEffect(() => { } }) + </script> <template> <div> -- GitLab