diff --git a/src/main.ts b/src/main.ts index c7b56d0..70cf87d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,7 @@ import { CogSpeedGame } from "./routes/game"; import { StartPage } from "./routes/start"; import { Config } from "./types/Config"; import { CogSpeedGraphicsHandler } from "./ui/handler"; +import { SleepData } from "./types/SleepData"; function createApp(): Application { @@ -49,7 +50,7 @@ async function loadConfig(): Promise { * @param config * @param startNow Called from restart. Bypasses sleep data */ -export async function startUp(config: Config | null = null, startNowData: Record | false = false) { +export async function startUp(config: Config | null = null, startNowData: SleepData | false = false) { if (config === null) { config = await loadConfig(); if (config.error) throw new Error(config.reason); diff --git a/src/routes/start.ts b/src/routes/start.ts index e547bcc..70ca2b3 100644 --- a/src/routes/start.ts +++ b/src/routes/start.ts @@ -339,12 +339,12 @@ private async confirmSleepData(sleepData: { [key: string]: any }): Promise} The test data */ - public async start(sleepData: Record | false): Promise { + public async start(sleepData: SleepData | false): Promise { if (process.env.NODE_ENV === "development") return {fatigueLevel: -1}; if (sleepData != false) { await this.displayReadyDemo(Infinity); - return {fatigueLevel: 1}; + return sleepData; } // Display the test disclaimer