From 7c88a023101af462b40db939d9ee0ce2b9f32015 Mon Sep 17 00:00:00 2001 From: Kim Ying <15070078+kimprice@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:10:30 -0800 Subject: [PATCH] async await --- teachertool/src/components/DebugInput.tsx | 4 ++-- teachertool/src/transforms/runEvaluate.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/teachertool/src/components/DebugInput.tsx b/teachertool/src/components/DebugInput.tsx index 8f699724aab8..495f7469e1ad 100644 --- a/teachertool/src/components/DebugInput.tsx +++ b/teachertool/src/components/DebugInput.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { Button } from "react-common/components/controls/Button"; import { Input } from "react-common/components/controls/Input"; import { Textarea } from "react-common/components/controls/Textarea"; -import { runEvaluate } from "../transforms/runEvaluate"; +import { runEvaluateAsync } from "../transforms/runEvaluate"; interface IProps {} @@ -13,7 +13,7 @@ const DebugInput: React.FC = ({}) => { const [rubric, setRubric] = useState(""); const evaluate = async () => { - runEvaluate(shareLink, rubric); + await runEvaluateAsync(shareLink, rubric); } return ( diff --git a/teachertool/src/transforms/runEvaluate.ts b/teachertool/src/transforms/runEvaluate.ts index 66b421b22f60..754306936592 100644 --- a/teachertool/src/transforms/runEvaluate.ts +++ b/teachertool/src/transforms/runEvaluate.ts @@ -1,6 +1,6 @@ import { getProjectMetaAsync, getProjectTextAsync } from "../services/BackendRequests"; -export async function runEvaluate(shareLink: string, rubric: string) { +export async function runEvaluateAsync(shareLink: string, rubric: string) { console.log(`Evaluate ${shareLink} with ${rubric}!`); const scriptId = pxt.Cloud.parseScriptId(shareLink); if (!scriptId) {