Skip to content

Commit ed290c5

Browse files
committed
remove unused isTheTourCompleted function and add check for server environment
1 parent cd2f33f commit ed290c5

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

app/components/CodeEditor/CodeEditor.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Flex, useColorMode } from "@chakra-ui/react";
88
import { useEffect, useState, useRef } from "react";
99
import MyBtn from "../MyBtn";
1010
import {
11-
isTheTourCompleted,
1211
tryFormattingCode,
1312
validateCode,
1413
} from "@/lib/client-functions";

lib/client-functions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ export function isChapterCompleted(chapterIndex: number, totalSteps: number) {
138138
}
139139

140140
export function isTheTourCompleted() {
141+
if (typeof window === "undefined") return false;
141142
const totalStepsForAllChapters =
142143
contentManager.getNumberOfStepsFromAllChapters();
143144
if (!localStorage.getItem("progress")) {

0 commit comments

Comments
 (0)