Skip to content

Commit c8a7b7d

Browse files
committed
fix: Fix runtime issues of every code editor
1 parent 74d8b47 commit c8a7b7d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

frontend/src/lib/CodeEditorLib.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PINSTON_API } from "@/constants";
2-
import { LANGUAGE_CONFIG } from "@/constants/CodeEditorConstant";
2+
import { LANGUAGE_CONFIG_CONSTANT } from "@/constants/languageConstants";
33
import { CodeEditorState } from "@/types/CodeEditorTypes";
44
import { ReactCodeMirrorRef } from "@uiw/react-codemirror";
55
import { create } from "zustand";
@@ -62,7 +62,7 @@ export const useCodeEditorStore = create<CodeEditorState>((set, get) => {
6262
// running the code
6363
runCode: async (language, code, inputs) => {
6464
try {
65-
const runtime = LANGUAGE_CONFIG[language].pistonRuntime;
65+
const runtime = LANGUAGE_CONFIG_CONSTANT[language].pistonRuntime;
6666

6767
const response = await fetch(PINSTON_API, {
6868
method: "POST",

frontend/src/pages/CodingPlayground.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const CodingPlayground = () => {
105105
await runCode(selectedLanguage, userCode, inputValue);
106106

107107
const result = getExecutionResult();
108-
console.log(result)
108+
109109
if (result) {
110110
setOutput(result.output);
111111
setStatus(result.error ? "Error" : "Success");
@@ -121,8 +121,7 @@ const CodingPlayground = () => {
121121
// setup the editor when language changes
122122
useEffect(() => {
123123
const savedCode = localStorage.getItem(`editor-code-${selectedLanguage}`);
124-
console.log("savedCode", savedCode)
125-
console.log("editor", editor)
124+
126125
if (editor && savedCode) {
127126
editor.view?.dispatch({
128127
changes: {

0 commit comments

Comments
 (0)