From f537b72cd9971d4e672fb75c716afa83eca3b485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Wed, 10 Apr 2024 16:07:52 +0200 Subject: [PATCH] pkp/pkp-lib#9870 Fix edge case, when one modal replaces another --- src/stores/modalStore.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stores/modalStore.js b/src/stores/modalStore.js index 4caef80c8..c71ef0243 100644 --- a/src/stores/modalStore.js +++ b/src/stores/modalStore.js @@ -107,6 +107,10 @@ export const useModalStore = defineStore('modal', () => { modalToClose = sideModal2; } + // it might have been replaced with other modal + if (!modalToClose) { + return; + } modalToClose.value.opened = false; // To keep the side modal animation nice, it needs to keep the component&props around for bit longer