make manifest fix more future proof
This commit is contained in:
parent
49c4700fae
commit
32591b35d0
11
src/main.ts
11
src/main.ts
|
@ -99,13 +99,16 @@ const startGame = async (manifest?: any) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let manifest: any;
|
||||||
fetch("/manifest.json")
|
fetch("/manifest.json")
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(jsonResponse => {
|
.then(jsonResponse => {
|
||||||
startGame(jsonResponse.manifest);
|
manifest = jsonResponse.manifest;
|
||||||
}).catch(() => {
|
}).catch(err => {
|
||||||
// Manifest not found (likely local build)
|
// Manifest not found (likely local build or error path on live)
|
||||||
startGame();
|
console.log(`Manifest not found. ${err}`);
|
||||||
|
}).finally(() => {
|
||||||
|
startGame(manifest);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default game;
|
export default game;
|
||||||
|
|
Loading…
Reference in New Issue