diff --git a/packages/upset/src/components/AltTextSidebar.tsx b/packages/upset/src/components/AltTextSidebar.tsx index f271dfb9..ae463ba5 100644 --- a/packages/upset/src/components/AltTextSidebar.tsx +++ b/packages/upset/src/components/AltTextSidebar.tsx @@ -48,7 +48,7 @@ export const AltTextSidebar: FC = ({ open, close, generateAltText }) => { const currState = useRecoilValue(upsetConfigAtom); const [altText, setAltText] = useState(null); - const [textGenErr, setTextGenErr] = useState(false); + const [textGenErr, setTextGenErr] = useState(false); // States for editing the alt text const [textEditing, setTextEditing] = useState(false); @@ -65,13 +65,7 @@ export const AltTextSidebar: FC = ({ open, close, generateAltText }) => { setTextGenErr(false); } catch (e) { const msg: string = (e as Error).message; - // We want the error message to display on the frontend - setAltText({ - longDescription: msg, - shortDescription: msg, - techniqueDescription: msg, - }); - setTextGenErr(true); + setTextGenErr(msg); } } @@ -178,7 +172,9 @@ export const AltTextSidebar: FC = ({ open, close, generateAltText }) => { text={"When enabled, displays the long text description for this plot instead of the short version."} margin={{left: 12, top: 0, right: 0, bottom: 0}} /> - ) : null} + ) : ( + {textGenErr} + )} {textEditing ? (<>