web: Rename lastLoaded to nativeConstructor

This commit is contained in:
Nathan Adams 2023-10-15 20:14:46 +02:00
parent a9db2584c8
commit 307f9bc820
1 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ type Ruffle =
| (typeof import("../dist/ruffle_web"))["Ruffle"]
| (typeof import("../dist/ruffle_web-wasm_extensions"))["Ruffle"];
let lastLoaded: Promise<Ruffle> | null = null;
let nativeConstructor: Promise<Ruffle> | null = null;
/**
* Obtain an instance of `Ruffle`.
@ -131,9 +131,9 @@ export function loadRuffle(
config: BaseLoadOptions,
progressCallback?: ProgressCallback,
): Promise<Ruffle> {
if (lastLoaded === null) {
lastLoaded = fetchRuffle(config, progressCallback);
if (nativeConstructor === null) {
nativeConstructor = fetchRuffle(config, progressCallback);
}
return lastLoaded;
return nativeConstructor;
}