From 777a53a0f01fdf35b41b7324c07f3399dcf4cb3c Mon Sep 17 00:00:00 2001 From: FurryR Date: Fri, 4 Oct 2024 10:58:15 +0800 Subject: [PATCH] fix(extension): always clear loadingPromise after calling --- src/extension-support/extension-load-helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extension-support/extension-load-helper.js b/src/extension-support/extension-load-helper.js index 8f7c8b26..ccc1805c 100644 --- a/src/extension-support/extension-load-helper.js +++ b/src/extension-support/extension-load-helper.js @@ -38,6 +38,7 @@ const clearScratchAPI = () => { globalScratch = undefined; } if (loadingPromise) loadingPromise.resolve(); + loadingPromise = undefined; } }; @@ -188,12 +189,12 @@ const loadExtension = async (vm, url) => { return pm.promise .then((v) => { if (scriptError) { - loadingPromise = undefined; throw scriptError; } return v; }) .finally(() => { + loadingPromise = undefined; removeScript(); }); };