From 5df89a56a9269b2195247c58ad5e0d42730e4b77 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Wed, 30 Oct 2024 13:56:38 +0000 Subject: [PATCH] Remove unnecessary json parse, pass data as string --- gui/src/app/FileEditor/TextEditor.tsx | 1 - gui/src/app/RunPanel/RunPanel.tsx | 3 +-- gui/src/app/components/TabWidget.tsx | 1 - .../pages/HomePage/SamplingWindow/SamplingWindow.tsx | 11 ++--------- gui/src/main.tsx | 1 - 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/gui/src/app/FileEditor/TextEditor.tsx b/gui/src/app/FileEditor/TextEditor.tsx index 11b18d3a..71bb792e 100644 --- a/gui/src/app/FileEditor/TextEditor.tsx +++ b/gui/src/app/FileEditor/TextEditor.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { Editor, loader, useMonaco } from "@monaco-editor/react"; import { useTheme } from "@mui/material/styles"; diff --git a/gui/src/app/RunPanel/RunPanel.tsx b/gui/src/app/RunPanel/RunPanel.tsx index 442ae77e..c58200e4 100644 --- a/gui/src/app/RunPanel/RunPanel.tsx +++ b/gui/src/app/RunPanel/RunPanel.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { FunctionComponent, useCallback, useContext, useMemo } from "react"; import Button from "@mui/material/Button"; @@ -14,7 +13,7 @@ import Tooltip from "@mui/material/Tooltip"; type RunPanelProps = { sampler?: StanSampler; latestRun: StanRun; - data: any | undefined; + data: string; dataIsSaved: boolean; samplingOpts: SamplingOpts; }; diff --git a/gui/src/app/components/TabWidget.tsx b/gui/src/app/components/TabWidget.tsx index 2691aa9a..edf39d4e 100644 --- a/gui/src/app/components/TabWidget.tsx +++ b/gui/src/app/components/TabWidget.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import Box from "@mui/material/Box"; import Tab from "@mui/material/Tab"; import Tabs from "@mui/material/Tabs"; diff --git a/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx b/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx index f3658827..b1bfee9e 100644 --- a/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx +++ b/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx @@ -1,4 +1,4 @@ -import { FunctionComponent, useCallback, useContext, useMemo } from "react"; +import { FunctionComponent, useCallback, useContext } from "react"; import Box from "@mui/material/Box"; import Divider from "@mui/material/Divider"; @@ -23,13 +23,6 @@ type SamplingWindowProps = { const SamplingWindow: FunctionComponent = () => { const { data, update } = useContext(ProjectContext); - const parsedData = useMemo(() => { - try { - return JSON.parse(data.dataFileContent); - } catch (e) { - return ""; - } - }, [data.dataFileContent]); const setSamplingOpts = useCallback( (opts: SamplingOpts) => { @@ -55,7 +48,7 @@ const SamplingWindow: FunctionComponent = () => { diff --git a/gui/src/main.tsx b/gui/src/main.tsx index aebb7a6c..7708eb5a 100644 --- a/gui/src/main.tsx +++ b/gui/src/main.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import * as ReactDOM from "react-dom/client"; import App from "./app/App";