diff --git a/src/assets/results_graph.png b/src/assets/results_graph.png index 288c09a..fa48d73 100644 Binary files a/src/assets/results_graph.png and b/src/assets/results_graph.png differ diff --git a/src/main.ts b/src/main.ts index d5cdff4..c7b56d0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -49,7 +49,7 @@ async function loadConfig(): Promise { * @param config * @param startNow Called from restart. Bypasses sleep data */ -export async function startUp(config: Config | null = null, startNow: boolean = false) { +export async function startUp(config: Config | null = null, startNowData: Record | false = false) { if (config === null) { config = await loadConfig(); if (config.error) throw new Error(config.reason); @@ -81,10 +81,10 @@ export async function startUp(config: Config | null = null, startNow: boolean = // Display the home page const startPage = new StartPage(config, app, graphicsManager); - if (!startNow) await startPage.displayHomePage(); + if (startNowData == false) await startPage.displayHomePage(); // Display start page - const sleepData = await startPage.start(startNow); + const sleepData = await startPage.start(startNowData); if (!sleepData) throw new Error("No sleep data"); // Game phase - called after start button is clicked diff --git a/src/routes/results.ts b/src/routes/results.ts index d958b06..2175a46 100644 --- a/src/routes/results.ts +++ b/src/routes/results.ts @@ -228,7 +228,7 @@ export class ProcessResultsPage { Date/time: ${data._date} Location: ${data.location.normalizedLocation} Status: ${data.status} - Test duration: ${data.testDuration}s`, { + Test duration: ${data.testDuration/60}s`, { fontFamily: "Trebuchet", fontSize: 18, fill: 0xffffff, @@ -320,7 +320,7 @@ export class ProcessResultsPage { restartTestButtonContainer.on("pointerdown", () => { // TODO: Send back to home page this.app.destroy(); - startUp(config, true); + startUp(config, data.sleepData); }); const homeButton = this.ui.createButton( diff --git a/src/routes/start.ts b/src/routes/start.ts index 4f819dc..e547bcc 100644 --- a/src/routes/start.ts +++ b/src/routes/start.ts @@ -339,10 +339,10 @@ private async confirmSleepData(sleepData: { [key: string]: any }): Promise} The test data */ - public async start(skipToDisplay: boolean): Promise { + public async start(sleepData: Record | false): Promise { if (process.env.NODE_ENV === "development") return {fatigueLevel: -1}; - if (skipToDisplay) { + if (sleepData != false) { await this.displayReadyDemo(Infinity); return {fatigueLevel: 1}; }