From 45cd3b79bb2eaca973874cff22c6db28b64c9d93 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 26 Sep 2024 15:47:47 -0400 Subject: [PATCH] tweak: disable grace period by default --- src/emulator/src/main.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/emulator/src/main.js b/src/emulator/src/main.js index 42cb8d59b..e631690d1 100644 --- a/src/emulator/src/main.js +++ b/src/emulator/src/main.js @@ -2,6 +2,9 @@ console.log(`emulator running in mode: ${MODE}`) +// Set this to true when testing progress messages +const GRACE_PERIOD_ENABLED = false; + const PATH_V86 = MODE === 'dev' ? '/vendor/v86' : './vendor/v86'; const { XDocumentPTT } = require("../../phoenix/src/pty/XDocumentPTT"); @@ -197,13 +200,15 @@ window.onload = async function() emu_config = JSON.parse(emu_config); } - status.ts_phase_end = Date.now() + 10 * 1000; - status.phase = 'grace-period'; - const gradePeriodProgress = setInterval(() => { - status.phase_progress = UPDATE_ONLY; - }, 200); - await new Promise(resolve => setTimeout(resolve, 10 * 1000)); - clearInterval(gradePeriodProgress); + if ( GRACE_PERIOD_ENABLED ) { + status.ts_phase_end = Date.now() + 10 * 1000; + status.phase = 'grace-period'; + const gradePeriodProgress = setInterval(() => { + status.phase_progress = UPDATE_ONLY; + }, 200); + await new Promise(resolve => setTimeout(resolve, 10 * 1000)); + clearInterval(gradePeriodProgress); + } status.ts_phase_end = undefined; status.phase_progress = 0;