Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
update to 1.2
Browse files Browse the repository at this point in the history
Fix the issue where the source language and target language are the same.
  • Loading branch information
SIPC committed Mar 10, 2024
1 parent 5c0c2bf commit 74ce55c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ResultBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 10 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
<Loader2 className={`h-4 w-4 mr-1 animate-spin`} />
Expand Down

0 comments on commit 74ce55c

Please sign in to comment.