diff --git a/src/channel/index.ts b/src/channel/index.ts index b9734d64..07e4298f 100644 --- a/src/channel/index.ts +++ b/src/channel/index.ts @@ -83,6 +83,7 @@ class Channel implements Channel { // load continued tutorial position & progress const { position, progress } = await this.context.setTutorial(this.workspaceState, tutorial) + logger('CONTINUE STATE', position, progress) if (progress.complete) { // tutorial is already complete diff --git a/src/channel/state/Progress.ts b/src/channel/state/Progress.ts index 4b143d8d..636e2531 100644 --- a/src/channel/state/Progress.ts +++ b/src/channel/state/Progress.ts @@ -53,7 +53,7 @@ class Progress { throw new Error(`setStepComplete level not found for stepId ${stepId}`) } - if (currentLevel.steps[currentLevel.steps.length - 1]) { + if (currentLevel.steps[currentLevel.steps.length - 1].id === stepId) { // final step for level is complete next.levels[currentLevel.id] = true diff --git a/src/environment.ts b/src/environment.ts index a7355273..89a61125 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,12 +1,8 @@ -require('dotenv').config({ - path: './web-app/.env', -}) - import { getWorkspaceRoot } from './services/workspace' import * as os from 'os' // CodeRoad version -export const VERSION: string = process.env.npm_package_version || 'unknown' +export const VERSION = 'unknown' // Node env export type Env = 'test' | 'local' | 'development' | 'production' @@ -14,10 +10,10 @@ export type Env = 'test' | 'local' | 'development' | 'production' export const NODE_ENV: Env = process.env.NODE_ENV || 'production' // toggle logging in development -export const LOG: boolean = (process.env.REACT_APP_LOG || '').toLowerCase() === 'true' +export const LOG = false // error logging tool -export const SENTRY_DSN: string | null = process.env.SENTRY_DSN || null +export const SENTRY_DSN: string | null = null // uri path to the users project workspace export const WORKSPACE_ROOT: string = getWorkspaceRoot() diff --git a/src/services/logger/index.ts b/src/services/logger/index.ts index 8d193311..25ebb2b1 100644 --- a/src/services/logger/index.ts +++ b/src/services/logger/index.ts @@ -1,6 +1,6 @@ import { LOG } from '../../environment' -export type Log = string | object | null | undefined +export type Log = string | number | object | null | undefined const logger = (...messages: Log[]): void => { if (!LOG) {