From 172d030a4524937e5d92d30b5645c89380919b27 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 14 Mar 2022 15:14:42 +0100 Subject: [PATCH] DEV: Check if show-modal container is viable (#16170) --- app/assets/javascripts/discourse/app/lib/show-modal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/discourse/app/lib/show-modal.js b/app/assets/javascripts/discourse/app/lib/show-modal.js index dde3094b315..f2628490598 100644 --- a/app/assets/javascripts/discourse/app/lib/show-modal.js +++ b/app/assets/javascripts/discourse/app/lib/show-modal.js @@ -6,6 +6,9 @@ export default function (name, opts) { opts = opts || {}; let container = getOwner(this); + if (container.isDestroying || container.isDestroyed) { + return; + } // We use the container here because modals are like singletons // in Discourse. Only one can be shown with a particular state.