diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index d1b8da1..b9321fb 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -35,7 +35,7 @@ declare global {
function App() {
const [screenShotResult, setscreenShotResult] = useState(null);
- const [result, setResult] = useState("null");
+ const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
//retry button
@@ -309,7 +309,9 @@ function App() {
{screenShotResult && }
-
+
+ {/* */}
{/* When there is result or onError, show the retry button */}
{(result)
diff --git a/src/renderer/components/displayLatex.tsx b/src/renderer/components/displayLatex.tsx
index b17b16f..0878702 100644
--- a/src/renderer/components/displayLatex.tsx
+++ b/src/renderer/components/displayLatex.tsx
@@ -1,8 +1,19 @@
import { MathJax } from "better-react-mathjax"
-import React from "react"
+import React, { useEffect } from "react"
+declare global {
+ interface Window {
+ MathJax: any;
+ }
+}
export default function displayLatexResult(props: { latex: string}) {
-
+ //rerender the latex result when props.latex is changed
+ useEffect(() => {
+ // Assuming MathJax object is available globally
+ if (window.MathJax) {
+ window.MathJax.typesetPromise();
+ }
+ }, [props.latex]);
return (
diff --git a/src/renderer/components/promptSelect.tsx b/src/renderer/components/promptSelect.tsx
index 81af8b1..77b41dd 100644
--- a/src/renderer/components/promptSelect.tsx
+++ b/src/renderer/components/promptSelect.tsx
@@ -2,13 +2,13 @@ import React from "react"
import { Tabs, TabsList, TabsTrigger } from "../components/ui/tabs"
import { promptOptions } from "../lib/models"
-export default function promptSelect(props: { handlePromptChange: Function, model: string}) {
+export default function promptSelect(props: { handlePromptChange: Function, model: string, disabled: boolean}) {
const options = promptOptions as { [key: string]: { value: string; label: string; prompt: string; }[] };
return (
props.handlePromptChange(value)}>
{options[props.model].map((prompt,index) => (
- {prompt.label}
+ {prompt.label}
))}