Skip to content

Commit

Permalink
fix(extension): always clear loadingPromise after calling
Browse files Browse the repository at this point in the history
  • Loading branch information
FurryR committed Oct 4, 2024
1 parent fa4384f commit 777a53a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extension-support/extension-load-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const clearScratchAPI = () => {
globalScratch = undefined;
}
if (loadingPromise) loadingPromise.resolve();
loadingPromise = undefined;
}
};

Expand Down Expand Up @@ -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();
});
};
Expand Down

0 comments on commit 777a53a

Please sign in to comment.