Skip to content

Commit

Permalink
fix loading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stephtr committed Nov 6, 2023
1 parent eaa63db commit 1f223b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/src/lib/calculatorModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ let Variables: VariableDefinition[] = [];
export const getVariables = () => Variables;

function getLoadingState(): Promise<void> {
if (Module?.calculate) return Promise.resolve();
if (typeof Module !== 'undefined' && Module?.calculate)
return Promise.resolve();
return new Promise((resolve) => {
const onLoaded = async () => {
// It takes a bit longer for the `calculate` routine to be ready than
Expand Down

0 comments on commit 1f223b0

Please sign in to comment.