From a9e3666ffe278ebf340d75a4369958ee216a15ea Mon Sep 17 00:00:00 2001 From: Jeff Soules Date: Tue, 29 Oct 2024 15:21:59 -0400 Subject: [PATCH] Replace default unparsed JSON with empty string instead of undefined. --- .../app/pages/HomePage/SamplingWindow/SamplingWindow.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx b/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx index b5aaa52..f365882 100644 --- a/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx +++ b/gui/src/app/pages/HomePage/SamplingWindow/SamplingWindow.tsx @@ -3,6 +3,7 @@ import { FunctionComponent, useCallback, useContext, useMemo } from "react"; import Box from "@mui/material/Box"; import Divider from "@mui/material/Divider"; import Grid from "@mui/material/Grid"; +import { CompileContext } from "@SpCompilation/CompileContext"; import RunPanel from "@SpComponents/RunPanel"; import SamplerOutputView from "@SpComponents/SamplerOutputView"; import SamplingOptsPanel from "@SpComponents/SamplingOptsPanel"; @@ -13,9 +14,8 @@ import { SamplingOpts, } from "@SpCore/ProjectDataModel"; import AnalysisPyWindow from "@SpScripting/Analysis/AnalysisPyWindow"; -import useStanSampler, { StanRun } from "@SpStanSampler/useStanSampler"; import AnalysisRWindow from "@SpScripting/Analysis/AnalysisRWindow"; -import { CompileContext } from "@SpCompilation/CompileContext"; +import useStanSampler, { StanRun } from "@SpStanSampler/useStanSampler"; type SamplingWindowProps = { // none @@ -27,7 +27,7 @@ const SamplingWindow: FunctionComponent = () => { try { return JSON.parse(data.dataFileContent); } catch (e) { - return undefined; + return ""; } }, [data.dataFileContent]);