diff --git a/src/components/ResultBox.tsx b/src/components/ResultBox.tsx index 0822aa4..3786631 100644 --- a/src/components/ResultBox.tsx +++ b/src/components/ResultBox.tsx @@ -92,7 +92,7 @@ export function ResultContainer({ isExpanded, }: ResultContainerProps) { useEffect(() => { - const version = "1.1"; + const version = "1.2"; const localVersion = localStorage.getItem("version"); if (version !== localVersion) { const keys = Object.keys(localStorage); diff --git a/src/pages/index.tsx b/src/pages/index.tsx index fe23537..f9bb08e 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -173,7 +173,16 @@ export default function Home() { className={`mt-2`} variant={`default`} disabled={loader.translate} - onClick={submit} + onClick={() => { + if (from === to) { + toast({ + title: "Translate Error", + description: '源语言和目标语言不能相同', + }); + } else { + submit() + } + }} > {loader.translate && (