Optimize initial loading performance
This commit is contained in:
@@ -159,13 +159,7 @@ async function setupBattle(page, battle) {
|
||||
}, battle.selected);
|
||||
await page.reload({ waitUntil: 'domcontentloaded' });
|
||||
await page.waitForFunction(() => window.__HEROS_GAME__ !== undefined && window.__HEROS_DEBUG__ !== undefined, undefined, { timeout: 90000 });
|
||||
await page.evaluate((battleId) => {
|
||||
const game = window.__HEROS_GAME__;
|
||||
for (const scene of game.scene.getScenes(true)) {
|
||||
game.scene.stop(scene.scene.key);
|
||||
}
|
||||
game.scene.start('BattleScene', { battleId });
|
||||
}, battle.id);
|
||||
await page.evaluate((battleId) => window.__HEROS_DEBUG__.goToBattle(battleId), battle.id);
|
||||
await page.waitForFunction(
|
||||
(battleId) => {
|
||||
const state = window.__HEROS_DEBUG__?.battle();
|
||||
|
||||
Reference in New Issue
Block a user